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

Fix AndDocIdSet#IteratorBasedIterator to not violate initial doc state #5070

Merged
merged 1 commit into from Feb 10, 2014

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Feb 10, 2014

AndDocIdSet#IteratorBasedIterator was potentially initialized with
NO_MORE_DOCS which violates the initial state of DocIdSetIterator and
could lead to undefined behavior when used in a search context.

Closes #5049

IteratorBasedIterator(DocIdSet[] sets) throws IOException {
iterators = new DocIdSetIterator[sets.length];

public static DocIdSetIterator newDocIdSet(DocIdSet[] sets) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the method should be named newDocIdSetIterator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

@jpountz
Copy link
Contributor

jpountz commented Feb 10, 2014

+1 In addition to fixing the bug, I think this makes the iterator creation much better!

@s1monw
Copy link
Contributor Author

s1monw commented Feb 10, 2014

@jpountz pushed a new commit

@jpountz
Copy link
Contributor

jpountz commented Feb 10, 2014

+1

AndDocIdSet#IteratorBasedIterator was potentially initialized with
NO_MORE_DOCS which violates the initial state of DocIdSetIterator and
could lead to undefined behavior when used in a search context.

Closes elastic#5049
@s1monw s1monw merged commit 06f8a2e into elastic:master Feb 10, 2014
@clintongormley clintongormley added the :Search/Search Search-related issues that do not fall into other categories label Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v0.90.12 v1.0.0 v1.1.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssertionError during percolation using constant score query
3 participants