Unable to find a clean way to do this type of query -- is there a way to specify that these prefixes return only results with the word prefixes in order? Such that a valid return would be Alpha Beta and Beta Alpha would not return?
"query": {
"bool": {
"must": [
{
"match_phrase_prefix": {
"search_name": "Al"
}
},
{
"match_phrase_prefix": {
"search_name": "Be"
}
}
]
}
},
If you have indexed a
keyword-type version of the field, you can do this: