Reputation: 119
I want Solr to return a document only if all the tokens are present in the query. For example if a document have a text of "foo bar", then it will only be retrieved with a query like "foo bar", "foo bar baz", "bar foo baz". But not with "foo baz" or "baz bar".
It's similar to the Minimum Match (mm) provided with the DisMax parser, but mm will counts the matches from the query not the document.
I only need to retrieve a specific number of document, so it's also okay if there's a way to at least boost such documents to the top and take the first N document.
Upvotes: 2
Views: 89
Reputation: 377
Simply add double quotes to your query and it will search exact terms only.
eg. "foo bar" will bring "foo bar" only and not "foo something" or "bar something"
Upvotes: 0