better caching of missing filter / query

This commit is contained in:
kimchy 2010-10-22 19:44:25 +02:00
parent b0a0604473
commit 62526444fd
2 changed files with 6 additions and 6 deletions

View File

@ -50,11 +50,11 @@ public class MissingFieldQueryExtension implements FieldQueryExtension {
filter = new TermRangeFilter(fieldName, null, null, true, true); filter = new TermRangeFilter(fieldName, null, null, true, true);
} }
// we always cache this one, really does not change... // we always cache this one, really does not change... (exists)
filter = parseContext.cacheFilter(filter); 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 = new NotFilter(filter);
// cache the not filter as well, so it will be faster
filter = parseContext.cacheFilter(filter);
filter = wrapSmartNameFilter(filter, smartNameFieldMappers, parseContext); filter = wrapSmartNameFilter(filter, smartNameFieldMappers, parseContext);

View File

@ -85,11 +85,11 @@ public class MissingFilterParser extends AbstractIndexComponent implements XCont
filter = new TermRangeFilter(fieldName, null, null, true, true); filter = new TermRangeFilter(fieldName, null, null, true, true);
} }
// we always cache this one, really does not change... // we always cache this one, really does not change... (exists)
filter = parseContext.cacheFilter(filter); 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 = new NotFilter(filter);
// cache the not filter as well, so it will be faster
filter = parseContext.cacheFilter(filter);
filter = wrapSmartNameFilter(filter, smartNameFieldMappers, parseContext); filter = wrapSmartNameFilter(filter, smartNameFieldMappers, parseContext);
if (filterName != null) { if (filterName != null) {