In v0.90.1 , I have indexed following data :
"hits" : [ {
"_index" : "movies",
"_type" : "movie",
"_id" : "4",
"_score" : 1.0, "_source" : {"title": "44The Godfather","director": "44Francis","year": 441972,"country_code": "IT"}
}, {
"_index" : "movies",
"_type" : "movie",
"_id" : "5",
"_score" : 1.0, "_source" : {"title": "55The Godfather","director": "55Francis","year": 551972,"country_code": "INS"}
}, {
"_index" : "movies",
"_type" : "movie",
"_id" : "1",
"_score" : 1.0, "_source" : {"title": "22The Godfather","director": "22Francis","year": 221972,"country_code": "US"}
}, {
"_index" : "movies",
"_type" : "movie",
"_id" : "6",
"_score" : 1.0, "_source" : {"title": "66The Godfather","director": "66Francis","year": 661972,"country_code": "MN"}
}, {
"_index" : "movies",
"_type" : "movie",
"_id" : "2",
"_score" : 1.0, "_source" : {"title": "The Godfather","director": "Francis","year": 1972,"country_code": "IN"}
}, {
"_index" : "movies",
"_type" : "movie",
"_id" : "3",
"_score" : 1.0, "_source" : {"title": "33The Godfather","director": "33Francis","year": 331972,"country_code": "I"}
} ]
But when i was trying to fetch it using querystring it returns me data for "US", "I", "INS", "MN" but not returning any data for "IT" and "IN"
Query :=>
'{"query":{"bool":{"should":[{"query_string":{"default_field":"country_code","query":"US"}}],"minimum_number_should_match":1}}}'
result :=>
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "movies",
"_type" : "movie",
"_id" : "1",
"_score" : 1.0, "_source" : {"title": "22The Godfather","director": "22Francis","year": 221972,"country_code": "US"}
} ]
}
}
For "IN" : Query =>
'{"query":{"bool":{"should":[{"query_string":{"default_field":"country_code","query":"IN"}}],"minimum_number_should_match":1}}}'
Result :=>
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" :
}
}
I just dont know why it is not working for "IT" and "IN" ,But the same query works in latest version for both "IN" and "IT".
Is anyone facing the same problem for version 0.90.1? Is there any way to make it work in same version without upgrading?