lucene-dev mailing list archives

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

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

Doug Cutting commented on LUCENE-1169:
--------------------------------------

> iterator.skipTo(iterator.doc()) <=> iterator.next();// 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: 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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message