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 TermQuery(term), BooleanClause.Occur.FILTER); ScoreDoc[] hits = searcher.search(new ConstantScoreQuery(builder.build()), Integer.MAX_VALUE).scoreDocs; Javadoc says FILTER is like MUST except that these clauses do not participate in scoring. I was expecting FILTER behaves like MUST_NO, no? (FILTER-clause is excluded from the result set) Also, to disable scoring altogether, is it enough to wrap final boolean query using ConstantQuery?Or individual clauses should be wrapped to? MatchAllDocsQuery is already ConstantQuery, right? Thanks,Ahmet