I'm trying to match books based on an author and title. Unfortunately titles and authors used as input differ from those in elasticsearch, the words are in different orders and have other differences so I can't do exact matching. My book records have a field author and title. I've come up with the following query:
{
"query":{
"bool":{
"must":{
"query_string":{
"query":"Not the Israel My Parents Promised Me"
},
"fuzzy":{
"author":{
"value":"Peka, Harvey",
"boost":2
}
}
}
}
},
"from":1,
"size":1
}
It's giving the same result every time no matter what the input so it seems like there's a problem with it. Am I going about it the wrong way?
_allfield with the query_string, probably not what you want. Also, stick to the match query, usually better than query_string. - javanna