You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2017/12/27 15:04:28 UTC

[35/54] [abbrv] lucene-solr:jira/solr-11702: LUCENE-8104: Remove facet module compile-time dependency on queries

LUCENE-8104: Remove facet module compile-time dependency on 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/d9695cca
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d9695cca
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d9695cca

Branch: refs/heads/jira/solr-11702
Commit: d9695cca5512762957943f938a68d3f7e895b51d
Parents: b5ad314
Author: Alan Woodward <ro...@apache.org>
Authored: Tue Dec 19 09:23:04 2017 +0000
Committer: Alan Woodward <ro...@apache.org>
Committed: Wed Dec 20 13:22:12 2017 +0000

----------------------------------------------------------------------
 dev-tools/idea/lucene/facet/facet.iml                |  2 +-
 lucene/CHANGES.txt                                   |  3 +++
 lucene/facet/build.xml                               | 15 +++++----------
 .../apache/lucene/facet/LongValueFacetCounts.java    | 13 ++++---------
 .../lucene/facet/range/LongRangeFacetCounts.java     |  5 ++---
 .../facet/taxonomy/TaxonomyFacetSumValueSource.java  |  3 +--
 6 files changed, 16 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d9695cca/dev-tools/idea/lucene/facet/facet.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/lucene/facet/facet.iml b/dev-tools/idea/lucene/facet/facet.iml
index d5f9327..43a8c79 100644
--- a/dev-tools/idea/lucene/facet/facet.iml
+++ b/dev-tools/idea/lucene/facet/facet.iml
@@ -24,8 +24,8 @@
     </orderEntry>
     <orderEntry type="library" scope="TEST" name="JUnit" level="project" />
     <orderEntry type="module" scope="TEST" module-name="lucene-test-framework" />
+    <orderEntry type="module" scope="TEST" module-name="queries" />
     <orderEntry type="module" module-name="analysis-common" />
-    <orderEntry type="module" module-name="queries" />
     <orderEntry type="module" module-name="lucene-core" />
   </component>
 </module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d9695cca/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 98cdcd9..f6a3cc7 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -72,6 +72,9 @@ API Changes
   Users should instead use FunctionScoreQuery, possibly combined with
   a lucene expression (Alan Woodward)
 
+* LUCENE-8104: Remove facets module compile-time dependency on queries
+  (Alan Woodward)
+
 New Features
 
 * LUCENE-2899: Add new module analysis/opennlp, with analysis components

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d9695cca/lucene/facet/build.xml
----------------------------------------------------------------------
diff --git a/lucene/facet/build.xml b/lucene/facet/build.xml
index e91f162..2fc2f9a 100644
--- a/lucene/facet/build.xml
+++ b/lucene/facet/build.xml
@@ -27,20 +27,15 @@
 
   <path id="classpath">
     <path refid="base.classpath"/>
-    <pathelement path="${queries.jar}"/>
     <fileset dir="lib"/>
   </path>
 
-  <target name="compile-core" depends="jar-queries,common.compile-core" />
+  <path id="test.classpath">
+    <pathelement path="${queries.jar}"/>
+    <path refid="test.base.classpath"/>
+  </path>
 
-  <target name="javadocs" depends="javadocs-queries,compile-core,check-javadocs-uptodate"
-          unless="javadocs-uptodate-${name}">
-    <invoke-module-javadoc>
-      <links>
-        <link href="../queries"/>
-      </links>
-    </invoke-module-javadoc>
-  </target>
+  <target name="compile-core" depends="jar-queries,common.compile-core"/>
 
   <target name="run-encoding-benchmark" depends="compile-test">
     <java classname="org.apache.lucene.util.encoding.EncodingSpeed" fork="true" failonerror="true">

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d9695cca/lucene/facet/src/java/org/apache/lucene/facet/LongValueFacetCounts.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/LongValueFacetCounts.java b/lucene/facet/src/java/org/apache/lucene/facet/LongValueFacetCounts.java
index ac3f5b3..85fc6c5 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/LongValueFacetCounts.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/LongValueFacetCounts.java
@@ -23,11 +23,9 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.lucene.facet.FacetResult;
-import org.apache.lucene.facet.Facets;
+import com.carrotsearch.hppc.LongIntScatterMap;
+import com.carrotsearch.hppc.cursors.LongIntCursor;
 import org.apache.lucene.facet.FacetsCollector.MatchingDocs;
-import org.apache.lucene.facet.FacetsCollector;
-import org.apache.lucene.facet.LabelAndValue;
 import org.apache.lucene.index.DocValues;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.LeafReaderContext;
@@ -40,9 +38,6 @@ import org.apache.lucene.search.LongValuesSource;
 import org.apache.lucene.util.InPlaceMergeSorter;
 import org.apache.lucene.util.PriorityQueue;
 
-import com.carrotsearch.hppc.LongIntScatterMap;
-import com.carrotsearch.hppc.cursors.LongIntCursor;
-
 
 /** {@link Facets} implementation that computes counts for
  *  all uniqute long values, more efficiently counting small values (0-1023) using an int array,
@@ -72,14 +67,14 @@ public class LongValueFacetCounts extends Facets {
   }
 
   /** Create {@code LongValueFacetCounts}, using the provided
-   *  {@link org.apache.lucene.queries.function.ValueSource}.  If hits is
+   *  {@link LongValuesSource}.  If hits is
    *  null then all facets are counted. */
   public LongValueFacetCounts(String field, LongValuesSource valueSource, FacetsCollector hits) throws IOException {
     this(field, valueSource, hits, false);
   }
 
   /** Create {@code LongValueFacetCounts}, using the provided
-   *  {@link org.apache.lucene.queries.function.ValueSource}.
+   *  {@link LongValuesSource}.
    *  random access (implement {@link org.apache.lucene.search.DocIdSet#bits}). */
   public LongValueFacetCounts(String field, LongValuesSource valueSource, FacetsCollector hits,
                               boolean multiValued) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d9695cca/lucene/facet/src/java/org/apache/lucene/facet/range/LongRangeFacetCounts.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/range/LongRangeFacetCounts.java b/lucene/facet/src/java/org/apache/lucene/facet/range/LongRangeFacetCounts.java
index 0bf9959..337f819 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/range/LongRangeFacetCounts.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/range/LongRangeFacetCounts.java
@@ -24,7 +24,6 @@ import org.apache.lucene.facet.FacetsCollector;
 import org.apache.lucene.facet.FacetsCollector.MatchingDocs;
 import org.apache.lucene.index.IndexReaderContext;
 import org.apache.lucene.index.ReaderUtil;
-import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.search.DocIdSet;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.IndexSearcher;
@@ -53,13 +52,13 @@ public class LongRangeFacetCounts extends RangeFacetCounts {
   }
 
   /** Create {@code LongRangeFacetCounts}, using the provided
-   *  {@link ValueSource}. */
+   *  {@link LongValuesSource}. */
   public LongRangeFacetCounts(String field, LongValuesSource valueSource, FacetsCollector hits, LongRange... ranges) throws IOException {
     this(field, valueSource, hits, null, ranges);
   }
 
   /** Create {@code LongRangeFacetCounts}, using the provided
-   *  {@link ValueSource}, and using the provided Filter as
+   *  {@link LongValuesSource}, and using the provided Filter as
    *  a fastmatch: only documents passing the filter are
    *  checked for the matching ranges, which is helpful when
    *  the provided {@link LongValuesSource} is costly per-document,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d9695cca/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/TaxonomyFacetSumValueSource.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/TaxonomyFacetSumValueSource.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/TaxonomyFacetSumValueSource.java
index 6bc77c2..ccebd78 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/TaxonomyFacetSumValueSource.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/TaxonomyFacetSumValueSource.java
@@ -22,14 +22,13 @@ import java.util.List;
 import org.apache.lucene.facet.FacetsCollector;
 import org.apache.lucene.facet.FacetsCollector.MatchingDocs;
 import org.apache.lucene.facet.FacetsConfig;
-import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.DoubleValues;
 import org.apache.lucene.search.DoubleValuesSource;
 import org.apache.lucene.util.IntsRef;
 
 /** Aggregates sum of values from {@link
- *  FunctionValues#doubleVal}, for each facet label.
+ *  DoubleValues#doubleValue()}, for each facet label.
  *
  *  @lucene.experimental */
 public class TaxonomyFacetSumValueSource extends FloatTaxonomyFacets {