LUCENE-3936: Rename StringIndexDocValues to DocTermsIndexDocValues

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1307044 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Martijn van Groningen 2012-03-29 18:50:08 +00:00
parent 1a96461df8
commit c19e594ea2
8 changed files with 24 additions and 24 deletions

View File

@ -31,17 +31,18 @@ import org.apache.lucene.util.mutable.MutableValueStr;
import java.io.IOException;
/** Internal class, subject to change.
* Serves as base class for FunctionValues based on StringIndex
**/
public abstract class StringIndexDocValues extends FunctionValues {
/**
* Internal class, subject to change.
* Serves as base class for FunctionValues based on DocTermsIndex.
*/
public abstract class DocTermsIndexDocValues extends FunctionValues {
protected final FieldCache.DocTermsIndex termsIndex;
protected final ValueSource vs;
protected final MutableValueStr val = new MutableValueStr();
protected final BytesRef spare = new BytesRef();
protected final CharsRef spareChars = new CharsRef();
public StringIndexDocValues(ValueSource vs, AtomicReaderContext context, String field) throws IOException {
public DocTermsIndexDocValues(ValueSource vs, AtomicReaderContext context, String field) throws IOException {
try {
termsIndex = FieldCache.DEFAULT.getTermsIndex(context.reader(), field);
} catch (RuntimeException e) {
@ -155,11 +156,11 @@ public abstract class StringIndexDocValues extends FunctionValues {
}
public static final class StringIndexException extends RuntimeException {
public StringIndexException(final String fieldName,
final RuntimeException cause) {
super("Can't initialize StringIndex to generate (function) " +
"FunctionValues for field: " + fieldName, cause);
public StringIndexException(final String fieldName, final RuntimeException cause) {
super("Can't initialize StringIndex to generate (function) FunctionValues for field: " + fieldName, cause);
}
}

View File

@ -19,8 +19,7 @@ package org.apache.lucene.queries.function.valuesource;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.docvalues.StringIndexDocValues;
import org.apache.lucene.queries.function.ValueSource; //javadoc
import org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues;
import java.io.IOException;
import java.util.Map;
@ -36,7 +35,7 @@ public class BytesRefFieldSource extends FieldCacheSource {
@Override
public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
return new StringIndexDocValues(this, readerContext, field) {
return new DocTermsIndexDocValues(this, readerContext, field) {
@Override
protected String toTerm(String readableValue) {

View File

@ -19,12 +19,12 @@ package org.apache.solr.schema;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.TermRangeQuery;
import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.docvalues.StringIndexDocValues;
import org.apache.lucene.queries.function.valuesource.FieldCacheSource;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.CharsRef;
@ -458,7 +458,7 @@ class DateFieldSource extends FieldCacheSource {
@Override
public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
return new StringIndexDocValues(this, readerContext, field) {
return new DocTermsIndexDocValues(this, readerContext, field) {
@Override
protected String toTerm(String readableValue) {
// needed for frange queries to work properly

View File

@ -19,7 +19,7 @@ package org.apache.solr.schema;
import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.docvalues.StringIndexDocValues;
import org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues;
import org.apache.lucene.queries.function.valuesource.FieldCacheSource;
import org.apache.lucene.search.SortField;
import org.apache.lucene.util.BytesRef;
@ -121,7 +121,7 @@ class SortableDoubleFieldSource extends FieldCacheSource {
public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
final double def = defVal;
return new StringIndexDocValues(this, readerContext, field) {
return new DocTermsIndexDocValues(this, readerContext, field) {
private final BytesRef spare = new BytesRef();
@Override

View File

@ -19,7 +19,7 @@ package org.apache.solr.schema;
import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.docvalues.StringIndexDocValues;
import org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues;
import org.apache.lucene.queries.function.valuesource.FieldCacheSource;
import org.apache.lucene.search.SortField;
import org.apache.lucene.util.BytesRef;
@ -124,7 +124,7 @@ class SortableFloatFieldSource extends FieldCacheSource {
public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
final float def = defVal;
return new StringIndexDocValues(this, readerContext, field) {
return new DocTermsIndexDocValues(this, readerContext, field) {
private final BytesRef spare = new BytesRef();
@Override

View File

@ -19,7 +19,7 @@ package org.apache.solr.schema;
import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.docvalues.StringIndexDocValues;
import org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues;
import org.apache.lucene.queries.function.valuesource.FieldCacheSource;
import org.apache.lucene.search.SortField;
import org.apache.lucene.util.BytesRef;
@ -126,7 +126,7 @@ class SortableIntFieldSource extends FieldCacheSource {
public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
final int def = defVal;
return new StringIndexDocValues(this, readerContext, field) {
return new DocTermsIndexDocValues(this, readerContext, field) {
private final BytesRef spare = new BytesRef();
@Override

View File

@ -19,7 +19,7 @@ package org.apache.solr.schema;
import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.docvalues.StringIndexDocValues;
import org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues;
import org.apache.lucene.queries.function.valuesource.FieldCacheSource;
import org.apache.lucene.search.SortField;
import org.apache.lucene.util.BytesRef;
@ -124,7 +124,7 @@ class SortableLongFieldSource extends FieldCacheSource {
public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
final long def = defVal;
return new StringIndexDocValues(this, readerContext, field) {
return new DocTermsIndexDocValues(this, readerContext, field) {
private final BytesRef spare = new BytesRef();
@Override

View File

@ -19,7 +19,7 @@ package org.apache.solr.schema;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.docvalues.StringIndexDocValues;
import org.apache.lucene.queries.function.docvalues.DocTermsIndexDocValues;
import org.apache.lucene.queries.function.valuesource.FieldCacheSource;
import java.io.IOException;
@ -38,7 +38,7 @@ public class StrFieldSource extends FieldCacheSource {
@Override
public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
return new StringIndexDocValues(this, readerContext, field) {
return new DocTermsIndexDocValues(this, readerContext, field) {
@Override
protected String toTerm(String readableValue) {