LUCENE-8104: Remove facet module compile-time dependency on queries

This commit is contained in:
Alan Woodward 2017-12-19 09:23:04 +00:00
parent b5ad314835
commit d9695cca55
6 changed files with 16 additions and 25 deletions

View File

@ -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>

View File

@ -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

View File

@ -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">

View File

@ -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 {

View File

@ -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,

View File

@ -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 {