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

David Smiley commented on LUCENE-4978:
--------------------------------------

Hi Oli,
This issue is indeed the root cause of the one you refer to in ES.  I spent a 
little time on fixing the problem months ago but held off because I wanted to 
better understand the performance trade-off, and I hadn't yet developed a 
benchmark -- through I have one now in LUCENE-2844.

Correct me if I'm wrong but I heard ES has a point-query optimization.  At 
least I thought I saw something like that when I looked through ES's docs a 
couple months ago.  I would like to add such an optimization within 
Lucene-spatial which would effectively avoid this particular issue you hit 
because it would end up being a simple Lucene term query.  This underlying 
issue would still exist though, it just wouldn't show up with a point query.

If you want a quick solution that only addresses intersection with a Point 
query, then you could modify the code I reference in the comment above to not 
use cell.getCenter() when queryShape is an instance of Point.  Make sense?

To be clear though, the quick solution or a solution optimizing a point query 
doesn't actually address the underlying problem; it just fixes it for point 
queries only.  It's still possible to index a point that fits inside a query 
rectangle extremely close to the edge, and depending on which side of the grid 
line the rectangle border is, you might not match the point.

> Spatial search with point query won't find identical indexed point
> ------------------------------------------------------------------
>
>                 Key: LUCENE-4978
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4978
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial
>    Affects Versions: 4.1
>            Reporter: David Smiley
>            Assignee: David Smiley
>            Priority: Minor
>             Fix For: 4.6
>
>
> Given a document with indexed POINT (10 20), when a search for INTERSECTS( 
> POINT (10 20)) is issued, no results are returned.
> The work-around is to not search with a point shape, use a very small-radius 
> circle or rectangle.  (I'm marking this issue as "minor" because it's easy to 
> do this).
> An unstated objective of the PrefixTree/grid approximation is that no matter 
> what precision you use, an intersects query will find all true-positives.  
> Due to approximations, it may also find some close false-positives.  But in 
> the case above, that unstated promise is violated.  But it can also happen 
> for query shapes other than points which do in fact barely enclose the point 
> given at index time yet the indexed point is in-effect shifted to the center 
> point of a cell which could be outside the query shape, and ultimately 
> leading to a false-negative.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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

Reply via email to