I need to make elasticsearch query to work with multiple words. I am using
edgeNgram tokenizer to support autocompletion feature and I am using
query_string for searching.
DOCUMENTS
{
"title":"Gold digital cinema",
"region":"MUMBAI"
}
{
"title":"cine park",
"region":"MUMBAI"
}
{
"title":"Premier Gold",
"region":"MUMBAI"
}
QUERY
{
"query": {
"bool": {
"should": [
{
"query_string": {
"fields": [
"title.default_title^10",
"title.ngrams_front^2"
],
"query": "gold cine",
"boost": 2
}
},
{
"fuzzy": {
"title.default_title": {
"value": "gold cine",
"min_similarity": 0.5,
"max_expansions": 50,
"prefix_length": 0
}
}
},
{
"query_string": {
"fields": [
"region"
],
"query": "MUMBAI"
}
}
]
}
}
}
When I search for gold cine, I need "title":"Gold digital cinema" to be in the
top results. But I am getting "title":"cine park" and "title":"Premier Gold" in
top.
Is there any way to preserve position while searching? Thanks in advance.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/bddde391-125d-40ea-8e4b-0b34fbf087d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.