diff --git a/modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java b/modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java index 6acc90cf80a..cfe7d2a1f3f 100644 --- a/modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java +++ b/modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java @@ -18,7 +18,7 @@ package org.apache.lucene.search.grouping.function; */ import org.apache.lucene.index.IndexReader; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.search.FieldComparator; import org.apache.lucene.search.Scorer; @@ -45,7 +45,7 @@ public class FunctionAllGroupHeadsCollector extends AbstractAllGroupHeadsCollect private final Map groups; private final Sort sortWithinGroup; - private DocValues.ValueFiller filler; + private FunctionValues.ValueFiller filler; private MutableValue mval; private IndexReader.AtomicReaderContext readerContext; private Scorer scorer; @@ -105,7 +105,7 @@ public class FunctionAllGroupHeadsCollector extends AbstractAllGroupHeadsCollect public void setNextReader(IndexReader.AtomicReaderContext context) throws IOException { this.readerContext = context; - DocValues docValues = groupBy.getValues(vsContext, context); + FunctionValues docValues = groupBy.getValues(vsContext, context); filler = docValues.getValueFiller(); mval = filler.getValue(); diff --git a/modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java b/modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java index f17aba3af25..e046ad08551 100644 --- a/modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java +++ b/modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java @@ -18,7 +18,7 @@ package org.apache.lucene.search.grouping.function; */ import org.apache.lucene.index.IndexReader; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.search.grouping.AbstractAllGroupsCollector; import org.apache.lucene.util.mutable.MutableValue; @@ -36,7 +36,7 @@ import java.util.TreeSet; * the most relevant document of a group. * *

- * Implementation detail: Uses {@link ValueSource} and {@link DocValues} to retrieve the + * Implementation detail: Uses {@link ValueSource} and {@link FunctionValues} to retrieve the * field values to group by. * * @lucene.experimental @@ -47,7 +47,7 @@ public class FunctionAllGroupsCollector extends AbstractAllGroupsCollector groups = new TreeSet(); - private DocValues.ValueFiller filler; + private FunctionValues.ValueFiller filler; private MutableValue mval; /** @@ -79,7 +79,7 @@ public class FunctionAllGroupsCollector extends AbstractAllGroupsCollector * Often used when creating a {@link FunctionQuery}. * @@ -45,7 +45,7 @@ public abstract class ValueSource implements Serializable { * Gets the values for this reader and the context that was previously * passed to createWeight() */ - public abstract DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException; + public abstract FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException; @Override public abstract boolean equals(Object o); @@ -129,12 +129,12 @@ public abstract class ValueSource implements Serializable { /** * Implement a {@link org.apache.lucene.search.FieldComparator} that works - * off of the {@link DocValues} for a ValueSource + * off of the {@link FunctionValues} for a ValueSource * instead of the normal Lucene FieldComparator that works off of a FieldCache. */ class ValueSourceComparator extends FieldComparator { private final double[] values; - private DocValues docVals; + private FunctionValues docVals; private double bottom; private Map fcontext; diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java b/modules/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java index a856d9fc7b9..975bd4b63c1 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java @@ -28,11 +28,11 @@ public class ValueSourceScorer extends Scorer { protected IndexReader reader; private int doc = -1; protected final int maxDoc; - protected final DocValues values; + protected final FunctionValues values; protected boolean checkDeletes; private final Bits liveDocs; - protected ValueSourceScorer(IndexReader reader, DocValues values) { + protected ValueSourceScorer(IndexReader reader, FunctionValues values) { super(null); this.reader = reader; this.maxDoc = reader.maxDoc(); diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/BoolDocValues.java b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/BoolDocValues.java index 8244a8a00f4..e290ddc09c4 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/BoolDocValues.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/BoolDocValues.java @@ -1,12 +1,12 @@ package org.apache.lucene.queries.function.docvalues; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.util.mutable.MutableValue; import org.apache.lucene.util.mutable.MutableValueBool; -public abstract class BoolDocValues extends DocValues { +public abstract class BoolDocValues extends FunctionValues { protected final ValueSource vs; public BoolDocValues(ValueSource vs) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/DoubleDocValues.java b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/DoubleDocValues.java index c09e0222db2..069ba11491c 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/DoubleDocValues.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/DoubleDocValues.java @@ -1,11 +1,11 @@ package org.apache.lucene.queries.function.docvalues; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.util.mutable.MutableValue; import org.apache.lucene.util.mutable.MutableValueDouble; -public abstract class DoubleDocValues extends DocValues { +public abstract class DoubleDocValues extends FunctionValues { protected final ValueSource vs; public DoubleDocValues(ValueSource vs) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/FloatDocValues.java b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/FloatDocValues.java index 368a45a7a52..eb4daeb197b 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/FloatDocValues.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/FloatDocValues.java @@ -1,11 +1,11 @@ package org.apache.lucene.queries.function.docvalues; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.util.mutable.MutableValue; import org.apache.lucene.util.mutable.MutableValueFloat; -public abstract class FloatDocValues extends DocValues { +public abstract class FloatDocValues extends FunctionValues { protected final ValueSource vs; public FloatDocValues(ValueSource vs) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/IntDocValues.java b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/IntDocValues.java index fa6c455c81f..9dd50f452e7 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/IntDocValues.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/IntDocValues.java @@ -1,12 +1,12 @@ package org.apache.lucene.queries.function.docvalues; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.util.mutable.MutableValue; import org.apache.lucene.util.mutable.MutableValueInt; -public abstract class IntDocValues extends DocValues { +public abstract class IntDocValues extends FunctionValues { protected final ValueSource vs; public IntDocValues(ValueSource vs) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/LongDocValues.java b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/LongDocValues.java index da4934c609b..1767d4ecd73 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/LongDocValues.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/LongDocValues.java @@ -1,12 +1,12 @@ package org.apache.lucene.queries.function.docvalues; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.util.mutable.MutableValue; import org.apache.lucene.util.mutable.MutableValueLong; -public abstract class LongDocValues extends DocValues { +public abstract class LongDocValues extends FunctionValues { protected final ValueSource vs; public LongDocValues(ValueSource vs) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/StrDocValues.java b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/StrDocValues.java index b3da187471a..305c651dada 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/StrDocValues.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/StrDocValues.java @@ -1,11 +1,11 @@ package org.apache.lucene.queries.function.docvalues; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.util.mutable.MutableValue; import org.apache.lucene.util.mutable.MutableValueStr; -public abstract class StrDocValues extends DocValues { +public abstract class StrDocValues extends FunctionValues { protected final ValueSource vs; public StrDocValues(ValueSource vs) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/StringIndexDocValues.java b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/StringIndexDocValues.java index 7e0bf9278dc..58b049beccc 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/StringIndexDocValues.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/docvalues/StringIndexDocValues.java @@ -17,7 +17,7 @@ package org.apache.lucene.queries.function.docvalues; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.ValueSourceScorer; import org.apache.lucene.search.FieldCache; @@ -32,9 +32,9 @@ import org.apache.lucene.util.mutable.MutableValueStr; import java.io.IOException; /** Internal class, subject to change. - * Serves as base class for DocValues based on StringIndex + * Serves as base class for FunctionValues based on StringIndex **/ -public abstract class StringIndexDocValues extends DocValues { +public abstract class StringIndexDocValues extends FunctionValues { protected final FieldCache.DocTermsIndex termsIndex; protected final ValueSource vs; protected final MutableValueStr val = new MutableValueStr(); @@ -158,7 +158,7 @@ public abstract class StringIndexDocValues extends DocValues { public StringIndexException(final String fieldName, final RuntimeException cause) { super("Can't initialize StringIndex to generate (function) " + - "DocValues for field: " + fieldName, cause); + "FunctionValues for field: " + fieldName, cause); } } diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ByteFieldSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ByteFieldSource.java index 0e2e392bc9b..2a38693a978 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ByteFieldSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ByteFieldSource.java @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.Map; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.search.FieldCache; /** @@ -50,10 +50,10 @@ public class ByteFieldSource extends FieldCacheSource { } @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { final byte[] arr = cache.getBytes(readerContext.reader, field, parser, false); - return new DocValues() { + return new FunctionValues() { @Override public byte byteVal(int doc) { return arr[doc]; diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java index 920ac1e3efe..1e94b786993 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java @@ -18,7 +18,7 @@ package org.apache.lucene.queries.function.valuesource; */ import org.apache.lucene.index.IndexReader; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.docvalues.StringIndexDocValues; import org.apache.lucene.queries.function.ValueSource; //javadoc @@ -26,7 +26,7 @@ import java.io.IOException; import java.util.Map; /** - * An implementation for retrieving {@link DocValues} instances for string based fields. + * An implementation for retrieving {@link FunctionValues} instances for string based fields. */ public class BytesRefFieldSource extends FieldCacheSource { @@ -35,7 +35,7 @@ public class BytesRefFieldSource extends FieldCacheSource { } @Override - public DocValues getValues(Map context, IndexReader.AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map context, IndexReader.AtomicReaderContext readerContext) throws IOException { return new StringIndexDocValues(this, readerContext, field) { @Override diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ConstValueSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ConstValueSource.java index 869469577f1..4631a9aee0a 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ConstValueSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ConstValueSource.java @@ -18,7 +18,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.docvalues.FloatDocValues; import java.io.IOException; @@ -42,7 +42,7 @@ public class ConstValueSource extends ConstNumberSource { } @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { return new FloatDocValues(this) { @Override public float floatVal(int doc) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/DefFunction.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/DefFunction.java index 1b133a1c1b7..aa1cfe3845d 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/DefFunction.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/DefFunction.java @@ -17,7 +17,7 @@ package org.apache.lucene.queries.function.valuesource; */ import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.util.BytesRef; @@ -39,15 +39,15 @@ public class DefFunction extends MultiFunction { @Override - public DocValues getValues(Map fcontext, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map fcontext, AtomicReaderContext readerContext) throws IOException { return new Values(valsArr(sources, fcontext, readerContext)) { final int upto = valsArr.length - 1; - private DocValues get(int doc) { + private FunctionValues get(int doc) { for (int i=0; i sources, Map fcontext, AtomicReaderContext readerContext) throws IOException { - final DocValues[] valsArr = new DocValues[sources.size()]; + public static FunctionValues[] valsArr(List sources, Map fcontext, AtomicReaderContext readerContext) throws IOException { + final FunctionValues[] valsArr = new FunctionValues[sources.size()]; int i=0; for (ValueSource source : sources) { valsArr[i++] = source.getValues(fcontext, readerContext); @@ -67,10 +67,10 @@ public abstract class MultiFunction extends ValueSource { return valsArr; } - public class Values extends DocValues { - final DocValues[] valsArr; + public class Values extends FunctionValues { + final FunctionValues[] valsArr; - public Values(DocValues[] valsArr) { + public Values(FunctionValues[] valsArr) { this.valsArr = valsArr; } @@ -87,11 +87,11 @@ public abstract class MultiFunction extends ValueSource { } - public static String toString(String name, DocValues[] valsArr, int doc) { + public static String toString(String name, FunctionValues[] valsArr, int doc) { StringBuilder sb = new StringBuilder(); sb.append(name).append('('); boolean firstTime=true; - for (DocValues vals : valsArr) { + for (FunctionValues vals : valsArr) { if (firstTime) { firstTime=false; } else { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java index 81fa80eadff..755fbb4ba23 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java @@ -18,7 +18,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.docvalues.FloatDocValues; import org.apache.lucene.search.IndexSearcher; @@ -49,7 +49,7 @@ public class NormValueSource extends ValueSource { } @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { IndexSearcher searcher = (IndexSearcher)context.get("searcher"); Similarity sim = searcher.getSimilarityProvider().get(field); if (!(sim instanceof TFIDFSimilarity)) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumDocsValueSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumDocsValueSource.java index 768ade0031c..eadf8663229 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumDocsValueSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumDocsValueSource.java @@ -17,7 +17,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.util.ReaderUtil; @@ -35,7 +35,7 @@ public class NumDocsValueSource extends ValueSource { } @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { // Searcher has no numdocs so we must use the reader instead return new ConstIntDocValues(ReaderUtil.getTopLevelContext(readerContext).reader.numDocs(), this); } diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java index 2c95813dfca..38b01cccd30 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java @@ -22,13 +22,13 @@ import java.util.Map; import org.apache.lucene.index.DocValues.Source; import org.apache.lucene.index.DocValues.Type; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; /** - * Expert: obtains numeric field values from a {@link DocValues} field. + * Expert: obtains numeric field values from a {@link FunctionValues} field. * This {@link ValueSource} is compatible with all numerical - * {@link DocValues} + * {@link FunctionValues} * * @lucene.experimental * @@ -42,7 +42,7 @@ public class NumericIndexDocValueSource extends ValueSource { } @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { final Source source = readerContext.reader.docValues(field) .getSource(); Type type = source.type(); @@ -50,7 +50,7 @@ public class NumericIndexDocValueSource extends ValueSource { case FLOAT_32: case FLOAT_64: // TODO (chrism) Change to use FloatDocValues and IntDocValues - return new DocValues() { + return new FunctionValues() { @Override public String toString(int doc) { @@ -64,7 +64,7 @@ public class NumericIndexDocValueSource extends ValueSource { }; case VAR_INTS: - return new DocValues() { + return new FunctionValues() { @Override public String toString(int doc) { return "float: [" + floatVal(doc) + "]"; @@ -113,6 +113,6 @@ public class NumericIndexDocValueSource extends ValueSource { @Override public String toString() { - return "DocValues float(" + field + ')'; + return "FunctionValues float(" + field + ')'; } } diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/OrdFieldSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/OrdFieldSource.java index f4379570d91..09083004231 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/OrdFieldSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/OrdFieldSource.java @@ -19,7 +19,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.docvalues.IntDocValues; import org.apache.lucene.search.FieldCache; @@ -62,7 +62,7 @@ public class OrdFieldSource extends ValueSource { @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { final int off = readerContext.docBase; final IndexReader topReader = ReaderUtil.getTopLevelContext(readerContext).reader; final FieldCache.DocTermsIndex sindex = FieldCache.DEFAULT.getTermsIndex(topReader, field); diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/PowFloatFunction.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/PowFloatFunction.java index ec2ae94391b..a65b4d25d46 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/PowFloatFunction.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/PowFloatFunction.java @@ -17,7 +17,7 @@ package org.apache.lucene.queries.function.valuesource; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; /** Function to raise the base "a" to the power "b" @@ -37,7 +37,7 @@ public class PowFloatFunction extends DualFloatFunction { } @Override - protected float func(int doc, DocValues aVals, DocValues bVals) { + protected float func(int doc, FunctionValues aVals, FunctionValues bVals) { return (float)Math.pow(aVals.floatVal(doc), bVals.floatVal(doc)); } } diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ProductFloatFunction.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ProductFloatFunction.java index 5aa02540cd1..102fff97cb0 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ProductFloatFunction.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ProductFloatFunction.java @@ -17,7 +17,7 @@ package org.apache.lucene.queries.function.valuesource; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; /** @@ -34,9 +34,9 @@ public class ProductFloatFunction extends MultiFloatFunction { } @Override - protected float func(int doc, DocValues[] valsArr) { + protected float func(int doc, FunctionValues[] valsArr) { float val = 1.0f; - for (DocValues vals : valsArr) { + for (FunctionValues vals : valsArr) { val *= vals.floatVal(doc); } return val; diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java index fb6f2c78f84..92b8f70a3d3 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java @@ -18,7 +18,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.docvalues.FloatDocValues; import org.apache.lucene.search.*; @@ -51,7 +51,7 @@ public class QueryValueSource extends ValueSource { } @Override - public DocValues getValues(Map fcontext, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map fcontext, AtomicReaderContext readerContext) throws IOException { return new QueryDocValues(this, readerContext, fcontext); } @@ -193,8 +193,8 @@ class QueryDocValues extends FloatDocValues { public ValueFiller getValueFiller() { // // TODO: if we want to support more than one value-filler or a value-filler in conjunction with - // the DocValues, then members like "scorer" should be per ValueFiller instance. - // Or we can say that the user should just instantiate multiple DocValues. + // the FunctionValues, then members like "scorer" should be per ValueFiller instance. + // Or we can say that the user should just instantiate multiple FunctionValues. // return new ValueFiller() { private final MutableValueFloat mval = new MutableValueFloat(); diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.java index 95203a727af..c5ad99907b3 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/RangeMapFloatFunction.java @@ -18,7 +18,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.docvalues.FloatDocValues; import org.apache.lucene.search.IndexSearcher; @@ -55,8 +55,8 @@ public class RangeMapFloatFunction extends ValueSource { } @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { - final DocValues vals = source.getValues(context, readerContext); + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + final FunctionValues vals = source.getValues(context, readerContext); return new FloatDocValues(this) { @Override public float floatVal(int doc) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.java index 98596e66dca..246c5b6e250 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReciprocalFloatFunction.java @@ -18,7 +18,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.docvalues.FloatDocValues; import org.apache.lucene.search.IndexSearcher; @@ -61,8 +61,8 @@ public class ReciprocalFloatFunction extends ValueSource { } @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { - final DocValues vals = source.getValues(context, readerContext); + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + final FunctionValues vals = source.getValues(context, readerContext); return new FloatDocValues(this) { @Override public float floatVal(int doc) { diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java index 56d876d383d..a54e15512a3 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java @@ -19,7 +19,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.docvalues.IntDocValues; import org.apache.lucene.search.FieldCache; @@ -62,7 +62,7 @@ public class ReverseOrdFieldSource extends ValueSource { } @Override - public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { + public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { final IndexReader topReader = ReaderUtil.getTopLevelContext(readerContext).reader; final int off = readerContext.docBase; diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.java index 6e2330a006b..a26f88acdd7 100755 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ScaleFloatFunction.java @@ -18,7 +18,7 @@ package org.apache.lucene.queries.function.valuesource; import org.apache.lucene.index.IndexReader.AtomicReaderContext; -import org.apache.lucene.queries.function.DocValues; +import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.docvalues.FloatDocValues; import org.apache.lucene.search.IndexSearcher; @@ -67,7 +67,7 @@ public class ScaleFloatFunction extends ValueSource { for (AtomicReaderContext leaf : leaves) { int maxDoc = leaf.reader.maxDoc(); - DocValues vals = source.getValues(context, leaf); + FunctionValues vals = source.getValues(context, leaf); for (int i=0; i