Fix for has_child can cause an infinite loop (100% CPU) when used in bool query.

Closes #3955
This commit is contained in:
Josh Canfield 2013-10-23 15:22:02 -07:00 committed by Adrien Grand
parent 35b573ff24
commit adadc72da3
1 changed files with 2 additions and 0 deletions

View File

@ -276,6 +276,7 @@ public class ChildrenQuery extends Query {
@Override
public int nextDoc() throws IOException {
if (remaining == 0) {
currentDocId = NO_MORE_DOCS;
return NO_MORE_DOCS;
}
@ -297,6 +298,7 @@ public class ChildrenQuery extends Query {
@Override
public int advance(int target) throws IOException {
if (remaining == 0) {
currentDocId = NO_MORE_DOCS;
return NO_MORE_DOCS;
}