[ 
https://issues.apache.org/jira/browse/LUCENE-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Busch updated LUCENE-1169:
----------------------------------

    Attachment: lucene-1169.patch

The problem is that in IndexSearcher#search() scorer.skipTo() is called without 
checking if the scorer is already at the same doc as the Filter's 
docIdSetIterator. And scorer.skipTo(scorer.doc()) behaves as scorer.next():

{code:java}
  /** Skips entries to the first beyond the current whose document number is
     * greater than or equal to <i>target</i>. <p>Returns true iff there is such
     * an entry.  <p>Behaves as if written: <pre>
     *   boolean skipTo(int target) {
     *     do {
     *       if (!next())
     *         return false;
     *     } while (target > doc());
     *     return true;
     *   }
     * </pre>
     * Some implementations are considerably more efficient than that.
     */
    public abstract boolean skipTo(int target) throws IOException;
{code}

which means that it is possible to miss the current doc (as Eks' testcase 
shows). 

All tests (including the new one) pass with this patch. I'll commit soon.

> Search with Filter does not work!
> ---------------------------------
>
>                 Key: LUCENE-1169
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1169
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Eks Dev
>            Assignee: Michael Busch
>            Priority: Blocker
>         Attachments: lucene-1169.patch, TestFilteredSearch.java
>
>
> See attached JUnitTest, self-explanatory

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to