I have a elastic field which contains a user name, eg. my name would contain vojtech knyttl.
I am trying to create a match query to be able to find my name by phrases like:
vojtech kvojtech knyknyttl
My query:
{
"bool" : {
"should" : [
{
"match" : {
"keywords" : {
"query" : "vojtech kn",
"operator" : "AND",
"prefix_length" : 0,
"max_expansions" : 50,
"minimum_should_match" : "50%",
}
}
}
]
}
}
the problem is that vojtech and vojtech kn will not find anything because of the AND operator. If I switch to OR, searching for vojtech knyttl will actually select every vojtech in the database and my last name will not be even at the top result.
How should the query be formed for such search?