Hi, folks!
I need your help with Mongo Atlas Search query creation where I should to have stemming+wildcard+slop requirements. Let’s see examples below:
User would like to find the next text: “Pay Stmt: new: Abbrev”
Analyzer: lucene.english for wright/search actions
User input: “Payed Abb”
Slop = 2
I found a couple partial solutions:
stemming+wildcard
[
{
$search: {
index: "FTSENText",
queryString: {
defaultPath: "text_EN",
query: "payed Abb*",
},
},
},
]
slop+stemming
[
{
$search:
{
index: "FTSENText",
compound: {
must: [
{
phrase: {
query: "payed Abbrev",
path: "text_EN",
slop: 2
},
},
],
},
},
},
]
So I need something like
[
{
$search:
{
index: "FTSENText",
compound: {
must: [
{
phrase: {
query: "payed Abb*",
path: "text_EN",
slop: 2
},
},
],
},
},
},
]
But this query above does not work, unfortunately. So I appreciate any thoughts from your side.
I know pure lucene provides this opportunity in code.
Thanks in advance!