SOLR-5012: optimize search with filter when filterCache is null

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1501004 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-07-08 23:05:58 +00:00
parent 5b257ac4df
commit 20a6de0241
2 changed files with 11 additions and 0 deletions

View File

@ -291,6 +291,8 @@ Optimizations
* SOLR-5002: optimize numDocs(Query,DocSet) when filterCache is null (Robert Muir)
* SOLR-5012: optimize search with filter when filterCache is null (Robert Muir)
Other Changes
----------------------

View File

@ -956,6 +956,15 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
}
}
if (filterCache == null) {
// there is no cache: don't pull bitsets
if (notCached == null) notCached = new ArrayList<Query>(sets.length-end);
WrappedQuery uncached = new WrappedQuery(q);
uncached.setCache(false);
notCached.add(uncached);
continue;
}
Query posQuery = QueryUtils.getAbs(q);
sets[end] = getPositiveDocSet(posQuery);
// Negative query if absolute value different from original