使用
createPhraseQuery("termos", "list of words")会精确地尝试将短语“单词列表”与短语坡度0匹配。如果要匹配单词列表中的 任何
术语,可以使用
createBooleanQuery:
new QueryBuilder(analyzer).createBooleanQuery("termos", terms, BooleanClause.Occur.SHOULD);或者,您也可以使用,
createMinShouldMatchQuery()以便您可以要求查询词的数量的一小部分进行匹配,例如。至少匹配10%的条款:
new QueryBuilder(analyzer).createMinShouldMatchQuery("termos", terms, 0.1f));


