Q:

Match each keyword at least once

I'm  trying to configure the scoring logic in Apache Solr 4.10.
I want to maximize the number of DISTINCT keywords matched.
In other words, each keyword should be matched at least once.
For example, this is what I'm currently seeing:
q=foo+bar+baz

Result:
doc1: foo foo foo foo foo foo foo
doc2: foo bar bar bar 
doc3: foo bar baz

This is not what I want. I want doc3 to appear at the top (since all keywords are matched), then doc2, then doc1. I tried setting mm=100% but then ONLY doc3 is returned and doc1 and doc2 are not displayed at all.
Any ideas?

A:

If you use  omitTermFreqAndPositions="true" in your field definition, you will get the result you want; the number of times a search term is matched in the document will not change the score; the score will then only be impacted by the number of different search terms that match the document.

