lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject [1/4] lucene-solr:master: SOLR-10399: Generalize some internal facet logic to simplify points/non-points field handling
Date Sat, 01 Apr 2017 01:25:12 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 1ae3cf4c5 -> c04a3acd8
  refs/heads/master 413555651 -> 35aac1d46


SOLR-10399: Generalize some internal facet logic to simplify points/non-points field handling


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

Branch: refs/heads/master
Commit: b60b86ecab797396ab6bd8be82740191922b0aa2
Parents: 4135556
Author: Chris Hostetter <hossman@apache.org>
Authored: Fri Mar 31 17:01:42 2017 -0700
Committer: Chris Hostetter <hossman@apache.org>
Committed: Fri Mar 31 17:01:42 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                      |  2 ++
 .../java/org/apache/solr/request/SimpleFacets.java    | 14 +++-----------
 2 files changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b60b86ec/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 097ee2b..1efefd0 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -178,6 +178,8 @@ Other Changes
 
 * SOLR-10338: Configure SecureRandom non blocking for tests. (Mihaly Toth, hossman, Ishan
Chattopadhyaya, via Mark Miller)
 
+* SOLR-10399: Generalize some internal facet logic to simplify points/non-points field handling
(Adrien Grand, hossman)
+
 ==================  6.5.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b60b86ec/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/request/SimpleFacets.java b/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
index b452802..8972121 100644
--- a/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
+++ b/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
@@ -851,17 +851,9 @@ public class SimpleFacets {
     SchemaField sf = searcher.getSchema().getField(field);
     FieldType ft = sf.getType();
     NamedList<Integer> res = new NamedList<>();
-    if (ft.isPointField()) {
-      for (String term : terms) {
-        int count = searcher.numDocs(ft.getFieldQuery(null, sf, term), parsed.docs);
-        res.add(term, count);
-      }
-    } else {
-      for (String term : terms) {
-        String internal = ft.toInternal(term);
-        int count = searcher.numDocs(new TermQuery(new Term(field, internal)), parsed.docs);
-        res.add(term, count);
-      }
+    for (String term : terms) {
+      int count = searcher.numDocs(ft.getFieldQuery(null, sf, term), parsed.docs);
+      res.add(term, count);
     }
     return res;    
   }


Mime
View raw message