lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sokolov <>
Subject AIOOBE in extension of ToParentBlockJoinQuery
Date Thu, 05 Feb 2015 17:02:25 GMT
I've run into an exception, and I'm trying to understand whether it is 
something that can just happen if the index doesn't conform to the 
expectations of the TPBJQ, or if I've somehow messed things up in my 
extension of that query.

The exception I'm seeing is in BlockJoinScorer.nextDoc().  It's clear 
that the assertion below is being contravened; No parentDoc is found for 
some child doc.

         // Gather all children sharing the same parent as
         // nextChildDoc

         parentDoc = parentBits.nextSetBit(nextChildDoc);
         assert parentDoc != -1;

         //System.out.println("  nextChildDoc=" + nextChildDoc);
         if (
             // parentDoc = -1 shouldn't happen, but it did.  I'm not sure
             // if this is a consequence of our allowing parents to be a
             // child -- I don't think so -- it seems more likely the index
             // can just get in a state where there are children with no
             // parent, and that could cause this?
             parentDoc == -1 ||
             (acceptDocs != null && !acceptDocs.get(parentDoc))
             ) {
           // Parent doc not accepted; skip child docs until
           // we hit a new parent doc:
           do {
             nextChildDoc = childScorer.nextDoc();
           } while (nextChildDoc <= parentDoc);

What I'm wondering is why we believe that assertion?  Is there something 
that guarantees the state of the index beyond the user having indexed 
their documents correctly?

I'm concerned that a change I made to the query may be causing this, but 
I can't see how.  What I did is to allow a parent doc to also be a child 
doc, and I also passed acceptDocs when creating the childScorer, so that 
child docs are filtered by the prevailing filter, as well as parent docs.

Any pointers or ideas welcome !  Thanks


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message