You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Bruno Roustant (JIRA)" <ji...@apache.org> on 2018/05/03 13:04:00 UTC

[jira] [Comment Edited] (LUCENE-8292) Fix FilterLeafReader.FilterTermsEnum to delegate all seekExact methods

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

Bruno Roustant edited comment on LUCENE-8292 at 5/3/18 1:03 PM:
----------------------------------------------------------------

When looking at TermsEnum API, what I understand is that seekExact() defaults to calling seekCeil(), but if needed (not for correctness but for performance consideration) we can override it to have a specialized seek that searches only the exact term and does not have to position to the next term if not found.

This may have an impact for some TermsEnum extensions (a really noticeable impact in my case, that's why I noticed this issue). To me the current behavior of FilterTermsEnum is not correct with regard to TermsEnum API. (And I noticed that AssertingLeafReader overrides seekExact()).

Adding these two methods in FilterTermsEnum fixes correctness, even if I agree it makes more room for bugs.


was (Author: bruno.roustant):
When looking at TermsEnum API, what I understand is that seekExact() defaults to calling seekCeil(), but if needed (not for correctness but for performance consideration) we can override it to have a specialized seek that searches only the exact term and does not have to position to the next term if not found.

This may have an impact for some TermsEnum extensions (a really noticeable impact in my case, that's why I noticed this issue). To me the current behavior of FilterTermsEnum is not correct with regard to TermsEnum API. (And I noticed that AssertingLeafReader overrides seekExact()).

Adding this two methods in FilterTermsEnum fixes correctness, even if I agree it makes more room for bugs.

> Fix FilterLeafReader.FilterTermsEnum to delegate all seekExact methods
> ----------------------------------------------------------------------
>
>                 Key: LUCENE-8292
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8292
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 7.2.1
>            Reporter: Bruno Roustant
>            Priority: Major
>             Fix For: trunk
>
>         Attachments: 0001-Fix-FilterLeafReader.FilterTermsEnum-to-delegate-see.patch, LUCENE-8292.patch
>
>
> FilterLeafReader#FilterTermsEnum wraps another TermsEnum and delegates many methods.
> It misses some seekExact() methods, thus it is not possible to the delegate to override these methods to have specific behavior (unlike the TermsEnum API which allows that).
> The fix is straightforward: simply override these seekExact() methods and delegate.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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