Hi Adrien,
Thank you for the explanation.
Here is what I have ended up with.
BooleanQuery.Builder builder = new BooleanQuery.Builder();
builder
.add(new MatchAllDocsQuery(), BooleanClause.Occur.FILTER)
.add(new TermQuery(term), BooleanClause.Occur.MUST_NOT);
Ahmet
On Friday, August 11, 2017,
FILTER does the opposite of MUST_NOT.
Regarding scoring, putting the query in a FILTER or MUST_NOT clause is good
enough since such clauses do not need scores. You do not need to add an
additional ConstantScoreQuery wrapper.
Le mar. 8 août 2017 à 23:06, Ahmet Arslan a
Hi all,
I am trying to access document lenght statistics of the documents that do not
contain a given term.
I have written following piece of code
BooleanQuery.Builder builder = new BooleanQuery.Builder();builder.add(new
MatchAllDocsQuery(), BooleanClause.Occur.MUST).add(new