lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <>
Subject [jira] Commented: (LUCENE-1169) Search with Filter does not work!
Date Fri, 08 Feb 2008 17:33:07 GMT


Doug Cutting commented on LUCENE-1169:

> iterator.skipTo(iterator.doc()) <=>;// is this contract?

Yes.  The reason is that TermDocs#doc() cannot be called when a TermDocs is first created,
since it is then positioned before the first entry.  One must call next() at least once before
first calling doc().  If the TermDocs is empty, then doc() should never be called.  Consider
the case of passing an empty TermDocs to skipTo(int): the call to next must be made, so that
'false' is returned without ever calling doc().

There are other ways of doing this, like defining that doc() returns -1 before next() has
ever been called, and/or returning Integer.MAX_VALUE after the last document.  But, for better
or worse, that's not the design that was chosen.

> Search with Filter does not work!
> ---------------------------------
>                 Key: LUCENE-1169
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Eks Dev
>            Assignee: Michael Busch
>            Priority: Blocker
>         Attachments: lucene-1169.patch,
> 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:
For additional commands, e-mail:

View raw message