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

Ignacio Vera commented on LUCENE-8721:
--------------------------------------

I tried the patch and I get a failure in another test: testLUCENE8669

It is true that in the current implementation a line on the dateline will never 
intersects any other shape but I see that more like a feature. Not sure if 
about this approach, more over when we have LUCENE-8634 where an indexed line 
query by itself might return an empty result.

> LatLonShapePolygon and LineQuery fail on shared dateline queries
> ----------------------------------------------------------------
>
>                 Key: LUCENE-8721
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8721
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Nicholas Knize
>            Priority: Major
>         Attachments: LUCENE-8721.patch, LUCENE-8721.patch
>
>
> Indexed shapes should be returned with search geometries that share the 
> dateline on the opposite hemisphere. 
> For example:
> {code:java}
>   public void testSharedDateline() throws Exception {
>     //// index /////
>     Directory dir = newDirectory();
>     RandomIndexWriter w = new RandomIndexWriter(random(), dir);
>     Document doc = new Document();
>     // index western hemisphere geometry
>     Polygon indexPoly = new Polygon(
>         new double[] {-7.5d, 15d, 15d, 0d, -7.5d},
>         new double[] {-180d, -180d, -176d, -176d, -180d}
>     );
>     Field[] fields = LatLonShape.createIndexableFields("test", indexPoly);
>     for (Field f : fields) {
>       doc.add(f);
>     }
>     w.addDocument(doc);
>     w.forceMerge(1);
>     ///// search //////
>     IndexReader reader = w.getReader();
>     w.close();
>     IndexSearcher searcher = newSearcher(reader);
>     // search w/ eastern hemisphere geometry that shares the dateline
>     Polygon searchPoly = new Polygon(new double[] {-7.5d, 15d, 15d, 0d, 
> -7.5d},
>         new double[] {180d, 180d, 170d, 170d, 180d});
>     Query q = LatLonShape.newPolygonQuery("test", QueryRelation.INTERSECTS, 
> searchPoly);
>     assertEquals(1, searcher.count(q));
>     IOUtils.close(w, reader, dir);
>   }
> {code}



--
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