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

Paul Elschot commented on LUCENE-5092:
--------------------------------------

To get to the beginning of a block that contains a given target document, we 
need something like advanceToJustBefore(target).

So we do not really need backward iteration for this, we need forward iteration 
by document blocks.
An implementation of this advanceToJustBefore can be made by using the current 
advance() and than look back, as currently by prevSetBit(). Any implementation 
could simply hide the retreat to the beginning of the block.

So how about this:
{code}
abstract class DocBlockIterator extends DocIdSetIterator {

  abstract int advanceToJustBefore(int target);
}
{code}
?
                
> join: don't expect all filters to be FixedBitSet instances
> ----------------------------------------------------------
>
>                 Key: LUCENE-5092
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5092
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/join
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>
> The join module throws exceptions when the parents filter isn't a 
> FixedBitSet. The reason is that the join module relies on prevSetBit to find 
> the first child document given a parent ID.
> As suggested by Uwe and Paul Elschot on LUCENE-5081, we could fix it by 
> exposing methods in the iterators to iterate backwards. When the join modules 
> gets an iterator which isn't able to iterate backwards, it would just need to 
> dump its content into another DocIdSet that supports backward iteration, 
> FixedBitSet for example.

--
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to