Hello,
We have a business requirement where the customer would like to run proximity searches that contain wildcards and phrases (multiple words).
For eg:
query: "somet*" within 5 word distance of "need to find"
should match: "something that we need to find"
should not match: "something to find is the need"
How can we achieve this in Elasticsearch?
I was able to solve the wildcard part but so far I couldn't figure out how to execute it with multi word phrases.
This is what I came up so far (missing the phrase requirement):
GET basic_tests/_search
{
"query": {
"span_near" : {
"clauses" : [
{ "span_multi": {"match" : {
"wildcard" : { "text" : { "value" : "somet*"} }
}}},
{ "span_multi": {"match" : {
"prefix" : { "text" : { "value" : "this is not working for phrase"} }
}}}
],
"slop" : 5,
"in_order" : true
}
}
}
Thanks!