} else if (token == XContentParser.Token.START_OBJECT) {
if ("must".equals(currentFieldName)) {
hasAnyFilter = true;
Filter filter = parseContext.parseInnerFilter();
if (filter != null) {
boolFilter.add(new FilterClause(filter, BooleanClause.Occur.MUST));
}
} else if ("must_not".equals(currentFieldName) || "mustNot".equals(currentFieldName)) {
hasAnyFilter = true;
Filter filter = parseContext.parseInnerFilter();
if (filter != null) {
boolFilter.add(new FilterClause(filter, BooleanClause.Occur.MUST_NOT));
}
} else if ("should".equals(currentFieldName)) {
hasAnyFilter = true;
Filter filter = parseContext.parseInnerFilter();
if (filter != null) {
boolFilter.add(new FilterClause(filter, BooleanClause.Occur.SHOULD));
}
} else {
throw new QueryParsingException(parseContext.index(), "[bool] filter does not support [" + currentFieldName + "]");
}
} else if (token == XContentParser.Token.START_ARRAY) {
if ("must".equals(currentFieldName)) {
hasAnyFilter = true;
while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
Filter filter = parseContext.parseInnerFilter();
if (filter != null) {
boolFilter.add(new FilterClause(filter, BooleanClause.Occur.MUST));
}
}
} else if ("must_not".equals(currentFieldName) || "mustNot".equals(currentFieldName)) {
hasAnyFilter = true;
while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
Filter filter = parseContext.parseInnerFilter();
if (filter != null) {
boolFilter.add(new FilterClause(filter, BooleanClause.Occur.MUST_NOT));
}
}
} else if ("should".equals(currentFieldName)) {
hasAnyFilter = true;
while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
Filter filter = parseContext.parseInnerFilter();
if (filter != null) {
boolFilter.add(new FilterClause(filter, BooleanClause.Occur.SHOULD));
}
}
} else {
throw new QueryParsingException(parseContext.index(), "[bool] filter does not support [" + currentFieldName + "]");
}