lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <>
Subject [jira] [Commented] (LUCENE-5502) equals method of TermsFilter might equate two different filters
Date Sat, 08 Mar 2014 16:25:43 GMT


Adrien Grand commented on LUCENE-5502:

Thank you Igor, I think this is a very bad bug!

Your fix looks good but I think there is still an issue given that offsets are not used for
the equality test. So (the very unlikely yet possible case of having) two filters that have
the same fields, same number of terms, same hash code and same term bytes but different offsets
would still be considered equal.

I think we should try to make this equals method easier to read in order not to have similar
issues in the future: maybe a start could be try to replace the comparison of the {{termsAndFields}}
array and the {{termBytes}} array with a call to {{Arrays.equals}}.

> equals method of TermsFilter might equate two different filters
> ---------------------------------------------------------------
>                 Key: LUCENE-5502
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/query/scoring
>    Affects Versions: 4.7
>            Reporter: Igor Motov
>         Attachments: LUCENE-5502.patch
> If two terms filters have 1) the same number of terms, 2) use the same field in all these
terms and 3) term values happened to have the same hash codes, these two filter are considered
to be equal as long as the first term is the same in both filters.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message