I'm trying to filter my elasticsearch's result, it must return the results which are 80% compatible with the search text.
When I do this for just one key, the minimum_should_match
works perfect:
{
"size":30,
"from":930,
"query":{
"filtered":{
"query":{
"query_string":{
"default_field":"campo1",
"query":"portugues",
"minimum_should_match":"80%"
}
}
}
}
}
When I search using more than one key, the minimum_should_match
doesn't work right, return the results with 70% compatibility:
{
"size":30,
"from":123420,
"query":{
"filtered":{
"query":{
"query_string":{
"default_operator":"or",
"query":"portugues",
"fields":[
"campo1",
"campo2^5",
"campo3"
],
"minimum_should_match":"80%"
}
}
}
}
}
As far as I can think of, I need to set minimum_should_match
by key, but I don't know how to do the same.
If someone can help me out in doing so, will be great.