I want to know the number of document items that have a specific value in it such as items that have a specific user name. So I queried on the dashboard with a filter on. (user:user1) It says 403 hits. And I queried this with count api. My json_data is {‘query’:{
‘match’:{
‘user’: ‘user1’,
},
},
}
When I run the code, it returns 835491. Why are the two numbers different? When I change ‘match’ in json to ‘term’, it returns 0.
I found that if the username value has a ‘.’, it just count the substring. For example, when I put ‘a.b’ as username, it counts items that have only ‘.b’. How can I count exact matching items even when the value has a ‘.’?
From your Initial request regarding differences between results between API and dashboards. Where are we with this? Could you provide queries and sample logs to use to show how to reproduce?
Before we move on to the exact matching, I would like to know more on the initial issue reported.
Leeroy.