Skip to content

Commit

Permalink
Query DSL: Query String _missing_ and _exists_ syntax, closes elastic…
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Oct 22, 2010
1 parent 9237daf commit 8b0daf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -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);

Expand Down
Expand Up @@ -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) {
Expand Down

0 comments on commit 8b0daf4

Please sign in to comment.