[ 
https://issues.apache.org/jira/browse/LUCENE-8670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16757107#comment-16757107
 ] 

Ignacio Vera commented on LUCENE-8670:
--------------------------------------

It seems there is a typo in one of the test that makes them fail. In the 
MultiPointValidator :
{code:java}
@Override
public boolean testPointQuery(double[][] queryPts, Object shape) {
  Point[] indexedPoints = (Point[])shape;
  for (Point p : indexedPoints) {
    boolean b = POINTVALIDATOR.testPointQuery(queryPts, indexedPoints);
    if (b == true && queryRelation == QueryRelation.INTERSECTS) {
      return true;
    } else if (b == false && queryRelation == QueryRelation.DISJOINT) {
      return false;
    } else if (b == false && queryRelation == QueryRelation.WITHIN) {
      return false;
    }
  }
  return queryRelation != QueryRelation.INTERSECTS;
}
{code}
You want to pass a single point to the POINTVALIDATOR and not the original 
array.

Otherwise looks good. I guess this implementation would be slow if a user 
queries using thousand points because at some point it iterates over all the 
provided points. I wonder if it is worthy to build a point tree (inspired on 
the EdgeTree) to filter out points.

 

 

 

 

> Add LatLonShapePointQuery to support Point / MultiPoint queries on indexed 
> LatLonShape fields
> ---------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-8670
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8670
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Nicholas Knize
>            Assignee: Nicholas Knize
>            Priority: Major
>         Attachments: LUCENE-8670.patch
>
>
> Similar to {{LatLonShapeBoundingBoxQuery}}, {{LatLonShapeLineQuery}}, and 
> {{LatLonShapePolygonQuery}} this introduces {{LatLonShapePointQuery}} that 
> will return all indexed {{LatLonShape}} fields that intersect the provided 
> point(s). {{MultiPoint}} is supported by providing an array of points.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to