hello folks,
I have a field name "AuthorLocationCountryCode" which contains the
abbrevation of the country code. Like United Kingdom = UK, India = IN ,
United State of America = US.
I am able to retrive data from elasticsearch with term filter query on US
and UK.
Below is the following query.
ELasticSearch Query :-
curl -XGET
'http://localhost:9200/new_index/new_indext/_search?pretty=false&size=2'
-d'{
"query": {
"match_all": {}
},
"filter": {
"term": {
"AuthorLocationCountryCode": "us"
}
},
"fields": [
"AuthorLocationCountryCode"
]
}'
OUTPUT :-
{"took":27,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":2197,"max_score":1.0,"hits":[{"_index":"new_index","_type":"new_indext","_id":"317576659379314689","_score":1.0,"fields":{"AuthorLocationCountryCode":"US
"}},{"_index":"new_index","_type":"new_indext","_id":"317576773602770944","_score":1.0,"fields":{"AuthorLocationCountryCode":"US
"}}]}}
But the query return nothing for INDIA = IN, though we have 120 records.
Elasticsearch Query For INDIA = IN
*curl -XGET
'http://localhost:9200/new_index/new_indext/_search?pretty=false&size=2'
-d'{
"query": {
"match_all": {}
},
"filter": {
"term": {
"AuthorLocationCountryCode": "in"
}
},
"fields": [
"AuthorLocationCountryCode"
]
}'
OUTPUT :-
{"took":6,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
*
Will you please guide why this strange behaviour is occuring.
thanks in advance
regrds
Mohit
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.