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

Adrien Grand resolved LUCENE-7885.
----------------------------------
    Resolution: Invalid

Right, the behaviour is undefined in that case. Documentation for {{seekExact}} 
states: {{Attempts to seek to the exact term, returning true if the term is 
found.  If this returns false, the enum is unpositioned.}} and documentation 
for {{postings}} states {{Do not call this when the enum is unpositioned}}. If 
you want to go to the next term when a term is not found, maybe you should use 
{{seekCeil}} instead?

For the record, you might want to consider using {{AssertingDirectoryReader}} 
in your tests, which would detect this kind of issues.

> Inconsistent return of documents in TermsEnum.postings after unsuccesful 
> TermsEnum.seekExact(bytes)
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-7885
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7885
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>         Environment: Linux / Centos X64:
> 3.14.33-26.47.amzn1.x86_64 #1 SMP Wed Feb 11 22:39:25 UTC 2015 x86_64 x86_64 
> x86_64 GNU/Linux
>            Reporter: Jeroen Baas
>
> Depending on the number of segments, TermsEnum.seekExact(bytes) to find a 
> non-existing term, followed by TermsEnum.postings() is inconsistently 
> returning different results.
> When *optimized* (to 1 segment in my test), the TermsEnum.postings() return 
> the PostingsEnum with documents associated with the next entry in the terms 
> list, if the term does not exist in the list.
> If the core is *not* optimized, TermsEnum.postings() returns null.
> In both cases, the TermsEnum.seekExact(bytes.toBytesRef()) and consecutive 
> TermsEnum.term appears to have advanced to the next entry (relative to the 
> non-existing term).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to