Query DSL: Query String _missing_ and _exists_ syntax, closes #446.

This commit is contained in:
kimchy 2010-10-22 17:54:02 +02:00
parent 9237dafef9
commit 8b0daf48f4
2 changed files with 6 additions and 2 deletions

View File

@ -50,9 +50,11 @@ public class MissingFieldQueryExtension implements FieldQueryExtension {
filter = new TermRangeFilter(fieldName, null, null, true, true);
}
filter = new NotFilter(filter);
// we always cache this one, really does not change...
filter = parseContext.cacheFilter(filter);
// we do the cached before the NotFilter, since there is no need to cache the not result, and this
// way we share with the exists filter
filter = new NotFilter(filter);
filter = wrapSmartNameFilter(filter, smartNameFieldMappers, parseContext);

View File

@ -85,9 +85,11 @@ public class MissingFilterParser extends AbstractIndexComponent implements XCont
filter = new TermRangeFilter(fieldName, null, null, true, true);
}
filter = new NotFilter(filter);
// we always cache this one, really does not change...
filter = parseContext.cacheFilter(filter);
// we do the cached before the NotFilter, since there is no need to cache the not result, and this
// way we share with the exists filter
filter = new NotFilter(filter);
filter = wrapSmartNameFilter(filter, smartNameFieldMappers, parseContext);
if (filterName != null) {