I have a data index in ElasticSearch
{
"name":"john",
"type":"main",
"address":"26, pression road, next to maha maul, Atlanta, USA",
"description":"i am from atlanta. i a need of help on elastic search. my name is john wosniak"
},
{
"name":"shailesh",
"type":"other",
"address":"c-401, greenfield road, next to cyber city, mumbai, india",
"description":"i am from mumbai. i dont need. my name shailesh"
},
{
"name":"pratik",
"type":"main",
"address":"c-116, parmar society, john main road, andhari, India",
"description":"i am from andhari. i a need of help on elastic search. my name is pratik doshi, i am good friend of john"
},...
I want to perform a search using some preliminary inquiry that he was looking for "type":"main", and "john"in other fields.
now i am using query
{
"query_string" : {
"fields" : ["name", "type","address", "description"],
"query" : "main john*"
}
}
it does not give me the desired result in accordance with my requirement.
I hope I have clearly explained. Thanks for the help in advance.
source
share