Lucene:如何从 n 个单词中搜索至少 m 个

Lucene: How to search for at least m out of n words

假设我要搜索 5 个词。有没有办法指定匹配文档应至少包含 4 个这样的词?

如果是 BooleanQuery,您可以设置 'minimumShouldMatch' 属性。这里是 API link 了解更多详情:http://lucene.apache.org/core/5_1_0/core/org/apache/lucene/search/BooleanQuery.html#setMinimumNumberShouldMatch(int)