Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NonNestedDocsFilter.getDocIDSet() looks buggy #8227

Closed
rmuir opened this Issue Oct 25, 2014 · 4 comments

Comments

Projects
None yet
3 participants
@rmuir
Copy link
Contributor

commented Oct 25, 2014

It modifies the docidset (casts to FixedBitSet and flips all the bits).

If this bitset was cached, this will be modifying the cached instance each time flipping all of its bits back and forth.

@rmuir rmuir added the >bug label Oct 25, 2014

martijnvg added a commit that referenced this issue Oct 27, 2014

Core: Cleanup non nested filter to not flip the bits in the FixedBitS…
…et returned by the wrapped filter.

If the filter producing the FBS were to be cached then it would flip bits each time the NonNestedDocsFilter was executed.
In our case we cache the NonNestedDocsFilter itself so that didn't happen each time this filter was used.
However the hashcode of NonNestedDocsFilter and NestedDocsFilter was the same, since NonNestedDocsFilter directly used NestedDocsFilter#hashCode()

Closes #8227
Closes #8232

martijnvg added a commit that referenced this issue Oct 27, 2014

Core: Cleanup non nested filter to not flip the bits in the FixedBitS…
…et returned by the wrapped filter.

If the filter producing the FBS were to be cached then it would flip bits each time the NonNestedDocsFilter was executed.
In our case we cache the NonNestedDocsFilter itself so that didn't happen each time this filter was used.
However the hashcode of NonNestedDocsFilter and NestedDocsFilter was the same, since NonNestedDocsFilter directly used NestedDocsFilter#hashCode()

Closes #8227
Closes #8232

@martijnvg martijnvg closed this in 35ede09 Oct 27, 2014

martijnvg added a commit that referenced this issue Oct 27, 2014

Core: Cleanup non nested filter to not flip the bits in the FixedBitS…
…et returned by the wrapped filter.

If the filter producing the FBS were to be cached then it would flip bits each time the NonNestedDocsFilter was executed.
In our case we cache the NonNestedDocsFilter itself so that didn't happen each time this filter was used.
However the hashcode of NonNestedDocsFilter and NestedDocsFilter was the same, since NonNestedDocsFilter directly used NestedDocsFilter#hashCode()

Closes #8227
Closes #8232
@jpountz

This comment has been minimized.

Copy link
Contributor

commented Oct 31, 2014

IndexedGeoBoundingBoxFilter has a similar issue: it modifies the bits returned by another filter

@martijnvg

This comment has been minimized.

Copy link
Member

commented Nov 3, 2014

@jpountz Right, it should instead like TermsFilter create a clean bitset and perform the or operation on that.

@jpountz

This comment has been minimized.

Copy link
Contributor

commented Nov 3, 2014

@martijnvg I tried to understand how it works and it looks like we could fix it and make the code simpler at the same time by just creating an BooleanFilter?

@martijnvg

This comment has been minimized.

Copy link
Member

commented Nov 3, 2014

@jpountz +1 I like it, this should work and we can reuse the BooleanFilter.

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Core: Cleanup non nested filter to not flip the bits in the FixedBitS…
…et returned by the wrapped filter.

If the filter producing the FBS were to be cached then it would flip bits each time the NonNestedDocsFilter was executed.
In our case we cache the NonNestedDocsFilter itself so that didn't happen each time this filter was used.
However the hashcode of NonNestedDocsFilter and NestedDocsFilter was the same, since NonNestedDocsFilter directly used NestedDocsFilter#hashCode()

Closes elastic#8227
Closes elastic#8232

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Core: Cleanup non nested filter to not flip the bits in the FixedBitS…
…et returned by the wrapped filter.

If the filter producing the FBS were to be cached then it would flip bits each time the NonNestedDocsFilter was executed.
In our case we cache the NonNestedDocsFilter itself so that didn't happen each time this filter was used.
However the hashcode of NonNestedDocsFilter and NestedDocsFilter was the same, since NonNestedDocsFilter directly used NestedDocsFilter#hashCode()

Closes elastic#8227
Closes elastic#8232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.