lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1709683 - in /lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet: FacetField.java UnInvertedField.java
Date Tue, 20 Oct 2015 21:05:40 GMT
Author: yonik
Date: Tue Oct 20 21:05:39 2015
New Revision: 1709683

URL: http://svn.apache.org/viewvc?rev=1709683&view=rev
Log:
LUCENE-6821: remove unnecessary term clones

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/FacetField.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/UnInvertedField.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/FacetField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/FacetField.java?rev=1709683&r1=1709682&r2=1709683&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/FacetField.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/FacetField.java Tue Oct
20 21:05:39 2015
@@ -1158,15 +1158,14 @@ class FacetFieldProcessorStream extends
 
         // OK, we have a good bucket to return... first get bucket value before moving to
next term
         Object bucketVal = sf.getType().toObject(sf, term);
-        BytesRef termCopy = BytesRef.deepCopyOf(term);
+        TermQuery bucketQuery = hasSubFacets ? new TermQuery(new Term(freq.field, term))
: null;
         term = termsEnum.next();
 
         SimpleOrderedMap<Object> bucket = new SimpleOrderedMap<>();
         bucket.add("val", bucketVal);
         addStats(bucket, 0);
         if (hasSubFacets) {
-          TermQuery filter = new TermQuery(new Term(freq.field, termCopy));
-          processSubs(bucket, filter, termSet);
+          processSubs(bucket, bucketQuery, termSet);
         }
 
         // TODO... termSet needs to stick around for streaming sub-facets?

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/UnInvertedField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/UnInvertedField.java?rev=1709683&r1=1709682&r2=1709683&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/UnInvertedField.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/facet/UnInvertedField.java
Tue Oct 20 21:05:39 2015
@@ -122,10 +122,11 @@ public class UnInvertedField extends Doc
     final BytesRef term = te.term();
 
     if (te.docFreq() > maxTermDocFreq) {
+      Term t = new Term(field, term);  // this makes a deep copy of the term bytes
       TopTerm topTerm = new TopTerm();
-      topTerm.term = BytesRef.deepCopyOf(term);
+      topTerm.term = t.bytes();
       topTerm.termNum = termNum;
-      topTerm.termQuery = new TermQuery(new Term(field, topTerm.term));
+      topTerm.termQuery = new TermQuery(t);
 
       bigTerms.put(topTerm.termNum, topTerm);
 



Mime
View raw message