Hi there,
I am searching the data in multitypes and the mapping for the izap_code is
as follows :
zip_code :{
"type":"long",
"index":"analyzed"
-
}*
And the request is as follows :
$curl _XGET
'http://localhost:9200/es_index/Registereduser,Registeredcity,Registeredstate/_search'
-d '{
"query" : {
-
"text": {*
-
"zip_code": {*
-
"type": "phrase_prefix",*
-
"query": "48703"*
-
}*
-
}*
-
}*
}'
*
*
The type Registereduser does not have the field zip_code, but the types
Registeredcity and Registeredstate do have it, and the above query is not
returning any response,
but if search without explicitly defining the types, then the results are
retrieved.
$curl _XGET 'http://localhost:9200/es_index/_search' -d '{
"query" : {
-
"text": {*
-
"zip_code": {*
-
"type": "phrase_prefix",*
-
"query": "48703"*
-
}*
-
}*
-
}*
}'
*
*
this is giving me the required results. and the surprising thing is if i
change the order of the types, the top query, then it works. e.g :
$curl _XGET 'http://localhost:9200/es_index/Registeredcity,Registeredstate,
Registereduser/_search' -d '{
"query" : {
-
"text": {*
-
"zip_code": {*
-
"type": "phrase_prefix",*
-
"query": "48703"*
-
}*
-
}*
-
}*
}'
*
*
Can anyone please explain why this is behaving like this ???? as I don't
have the control over the ordering of the types.
Thanks
Narinder Kaur