Count api value and the hit value on the dashboard doesn't match

Versions (relevant - OpenSearch/Dashboard 2.16/Server OS/Browser):

Describe the issue:

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.

Configuration:

Relevant Logs or Screenshots:

Hi @nevermet ,

This is a duplicate of the following - Count api value and the hit value on the dashboard doesn’t match - #2 by Leeroy

Leeroy.

Dear @Leeroy ,

Thank you for your answer.

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 ‘.’?

Thank you.