To clarify, I mean the facet operator within $search
, not the aggregation $tage by the same name.
Understood about your desired matching requirements. The text
operator OR’s all of the terms in the query, and so it is matching any of the terms. I think you can get some inspiration from the link to the “as-you-type” solution and the github repo and configuration there. Using the phrase
operator is advisable, in conjunction with other types of analysis (via multi
) that would shingle the text so that you get 2 or 3 word shingle matching. It takes some fiddling to get the sweet spot of analysis and query generation (there’s not just one operator that will serve your use case best - but rather a combination of several compound.should nested operators of text
and phrase
across various multi-analyzed field, and tune there for good matching relevancy, and minimize the spurious not-good matches from coming through by having the best ones in the top 10 or so, and then a $limit
can really help prune when the top ones are the best ones.