You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2018/02/28 17:38:48 UTC

lucene-solr:master: SOLR-11769: optimize useFilterForSortedQuery=true when no filter queries

Repository: lucene-solr
Updated Branches:
  refs/heads/master 1485b7a4d -> ef989124f


SOLR-11769: optimize useFilterForSortedQuery=true when no filter queries


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ef989124
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ef989124
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ef989124

Branch: refs/heads/master
Commit: ef989124f345af46a905d1196bc589ef37b221c9
Parents: 1485b7a
Author: David Smiley <ds...@apache.org>
Authored: Wed Feb 28 12:38:20 2018 -0500
Committer: David Smiley <ds...@apache.org>
Committed: Wed Feb 28 12:38:20 2018 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                               | 3 +++
 .../src/java/org/apache/solr/search/SolrIndexSearcher.java     | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef989124/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 3a297e0..6ddb6b3 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -239,6 +239,9 @@ Optimizations
 * SOLR-8327: Cluster state caching to avoid live fetch from ZK of cluster state for forwarding requests on nodes
   that do not host any replica of the collection (Jessica Cheng Mallet, John Gallagher, Noble Paul, Ishan Chattopadhyaya)
 
+* SOLR-11769: Optimize when useFilterForSortedQuery=true and there are no filter queries by avoiding
+  needless match-all-docs bitset construction. (Betim Deva, David Smiley)
+
 Other Changes
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef989124/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
index 3437476..8dadd37 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
@@ -1397,8 +1397,10 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
       // slower than simply re-executing the query.
       if (out.docSet == null) {
         out.docSet = getDocSet(cmd.getQuery(), cmd.getFilter());
-        DocSet bigFilt = getDocSet(cmd.getFilterList());
-        if (bigFilt != null) out.docSet = out.docSet.intersection(bigFilt);
+        List<Query> filterList = cmd.getFilterList();
+        if (filterList != null && !filterList.isEmpty()) {
+          out.docSet = out.docSet.intersection(getDocSet(cmd.getFilterList()));
+        }
       }
       // todo: there could be a sortDocSet that could take a list of
       // the filters instead of anding them first...