Difference between BooleanClause.Occur.Must and BooleanClause.Occur.SHOULD in lucene

BooleanClause.Occur.SHOULD means that the clause is optional, whereas BooleanClause.Occur.Must means that the clause is compulsory.

However, if a boolean query only has optional clauses, at least one clause must match for a document to appear in the results.

For better control over what documents match a BooleanQuery, there is also a minimumShouldMatch parameter which lets you tell Lucene that at least minimumShouldMatch BooleanClause.Occur.SHOULD clauses must match for a document to appear in the results.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)