Right way to achieve some sort of "reverse minimum should match = 100%"

Hi
In our project we often dealing with logic like "full document field should be present in the lookup query".
We've developed number of solutions for this (usage of highlighter, generation of tons of queries with all lookup term combinations, etc). But all this approaches are too slow.
Maybe there is a faster and simpler way to implement these logic?
For example you have document
{"text": "hello world"}
It should be found by query
hello world my friend
But not found by query
hello my friend

Seems like you could use a terms set query here, where required_matches is the number of tokens in each doc's text field.

1 Like

Thank you!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.