You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by hacker win7 <ha...@gmail.com> on 2020/09/25 12:55:11 UTC

PointInSetQuery dose not terminate early if DocIdSetBuilder's bitSet is null

Hi Lucene members,

In Lucene-7.7.0, I find that in `PointInSetQuery.createWeight()`, and in the method `scorer()` after `values.intersect()`, if the `result.bitSet` is null, then the `result.build()` would use `concat()` to generate a Buffer and the length is 1. And the element of array is `NO_MORE_DOCS`.

Why not return null in the method `scorer()` if `result.bitSet` is null ?

In the following case:

SubQuery1 AND SubQuery2 AND SubQuery3 …...

BooleanWeight.scorerSupplier() -> 

the first subScorer of query is PointInSetQuery -> 

scorer() ->

after intersect if result.bitSet is null, there is no specific point value at all then return null ->


This will terminate early inner the BooleanWeight.scoreSupplier() because subScore is null and the boolean clause is required

The following SubQuery2, SubQuery3, SubQuery4 …. Need not to call scorerSupplier() to build scorer



hacker win7
hackerswin7@gmail.com