jpountz commented on a change in pull request #546: LUCENE-8620: LatLonShape 
contains
URL: https://github.com/apache/lucene-solr/pull/546#discussion_r250142208
 
 

 ##########
 File path: 
lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapeQuery.java
 ##########
 @@ -163,17 +186,24 @@ public Scorer get(long leadCost) throws IOException {
         };
       }
 
-      /** get a scorer supplier for all other queries (DISJOINT, WITHIN) */
+      /** get a scorer supplier for all other queries (DISJOINT, WITHIN, 
CONTAINS) */
       protected ScorerSupplier getScorerSupplier(LeafReader reader, 
PointValues values, Weight weight, ScoreMode scoreMode) throws IOException {
         if (queryRelation == QueryRelation.INTERSECTS) {
           return getIntersectScorerSupplier(reader, values, weight, scoreMode);
         }
-        //For within and disjoint we need two passes to remove false positives 
in case of multi-shapes.
         FixedBitSet within = new FixedBitSet(reader.maxDoc());
         FixedBitSet disjoint = new FixedBitSet(reader.maxDoc());
-        IntersectVisitor withinVisitor = getDenseIntersectVisitor(within, 
disjoint, QueryRelation.WITHIN);
-        IntersectVisitor disjointVisitor = getDenseIntersectVisitor(within, 
disjoint, QueryRelation.DISJOINT);
-        return new RelationScorerSupplier(values, withinVisitor, 
disjointVisitor, queryRelation) {
+        IntersectVisitor visitor;
+        IntersectVisitor disjointVisitor;
+        if (queryRelation == QueryRelation.CONTAINS) {
+          visitor = getDenseIntersectVisitor(within, disjoint, queryRelation);
 
 Review comment:
   the `within`/`disjoint` naming of the bitsets feels a bit weird now (my 
fault, sorry!). Maybe `candidates`/`rejected` or something like that instead?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to