I m trying to find user by nationality using query_string but it query return other nationality records. Can anyone help me out how query_string is working.
curl -X GET 'http:/127.0.0.1:9200/user_alias/_search?size=1000&pretty' -d '{"query":{"filtered":{"query":{"query_string":{"query":"nationality:""AF"""}}}},"filter":{"and":[{"terms":{"room_id":["591"]}},{"bool":{"must":[{"exists":{"field":"nationality"}}]}},{"bool":{"must":[{"exists":{"field":"user.id"}}]}}]},"size":1000,"fields":["user.id", "nationality"]}'
For example
Data returns :
- id : 1
nationality : FA - id : 2
nationality : CA