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

David Smiley commented on LUCENE-4770:
--------------------------------------

The fix I was working on was to remove the optimization altogether.  With it 
removed, recursiveGetNodes() can be rewritten to be remarkably simpler and 
combined with the Point specialization of this method into one.  I've already 
done this locally and the code is easier to read and debug.  However the 
optimization is probably a noticeable benefit for the TermQuery strategy.  
Perhaps this implementation could move to TermQueryPrefixTreeStrategy.  
Alternatively it would be cool if the nodes could be pruned after the fact (in 
the strategy) but that would be hard since nodes are flattened into a list.  
I'm leaning towards moving this implementation to the strategy where I can see 
ways it could even be optimized more by bubbling this pruning up from now only 
the bottom level but up additional levels.  Thoughts?

p.s. the condition {{subCells.size() == node.getSubCellsSize() && 
!inclParents}} is not enough, it must also be true that node.getLevel() != 0 
because the 0 node is not indexable (no empty string).
                
> GeoShape intersects filter omitted matching docs
> ------------------------------------------------
>
>                 Key: LUCENE-4770
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4770
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial
>    Affects Versions: 4.0, 4.1
>            Reporter: Florian Schilling
>            Assignee: David Smiley
>             Fix For: 4.2, 5.0
>
>         Attachments: LUCENE-4770.patch
>
>
> SpatialPrefixTree#recursiveGetNodes uses an optimization that prevents
> recursion into the deepest tree level if a parent node in the penultimate
> level covers all its children.  This produces a bug if the optimization
> happens both at indexing and at query/filter time.
> [Original post|https://github.com/elasticsearch/elasticsearch/issues/2626]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to