mirror of https://github.com/apache/lucene.git
SOLR-10236: Remove FieldType.getNumericType() from master
This commit is contained in:
parent
e3a0b428fd
commit
abec54bd57
|
@ -50,6 +50,8 @@ Upgrading from Solr 6.x
|
|||
factors should be indexed in a separate field and combined with the query
|
||||
score using a function query.
|
||||
|
||||
* Deprecated method getNumericType() has been removed from FieldType. Use getNumberType() instead
|
||||
|
||||
New Features
|
||||
----------------------
|
||||
* SOLR-9857, SOLR-9858: Collect aggregated metrics from nodes and shard leaders in overseer. (ab)
|
||||
|
@ -80,6 +82,8 @@ Optimizations
|
|||
(yonik)
|
||||
|
||||
Other Changes
|
||||
* SOLR-10236: Removed FieldType.getNumericType(). Use getNumberType() instead. (Tomás Fernández Löbbe)
|
||||
|
||||
----------------------
|
||||
|
||||
================== 6.5.0 ==================
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package org.apache.solr.schema;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.time.Instant;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
@ -25,7 +24,6 @@ import java.util.Date;
|
|||
import org.apache.lucene.document.LongPoint;
|
||||
import org.apache.lucene.document.StoredField;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
import org.apache.lucene.legacy.LegacyNumericType;
|
||||
import org.apache.lucene.queries.function.ValueSource;
|
||||
import org.apache.lucene.queries.function.valuesource.LongFieldSource;
|
||||
import org.apache.lucene.queries.function.valuesource.MultiValuedLongFieldSource;
|
||||
|
@ -39,13 +37,9 @@ import org.apache.lucene.util.mutable.MutableValueLong;
|
|||
import org.apache.solr.search.QParser;
|
||||
import org.apache.solr.uninverting.UninvertingReader;
|
||||
import org.apache.solr.util.DateMathParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class DatePointField extends PointField implements DateValueFieldType {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public DatePointField() {
|
||||
type = NumberType.DATE;
|
||||
}
|
||||
|
@ -164,11 +158,6 @@ public class DatePointField extends PointField implements DateValueFieldType {
|
|||
return new MultiValuedLongFieldSource(field.getName(), choice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LegacyNumericType getNumericType() {
|
||||
return LegacyNumericType.LONG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexableField createField(SchemaField field, Object value) {
|
||||
if (!isFieldUsed(field)) return null;
|
||||
|
|
|
@ -17,14 +17,12 @@
|
|||
|
||||
package org.apache.solr.schema;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.lucene.document.DoublePoint;
|
||||
import org.apache.lucene.document.StoredField;
|
||||
import org.apache.lucene.index.DocValuesType;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
import org.apache.lucene.legacy.LegacyNumericType;
|
||||
import org.apache.lucene.queries.function.ValueSource;
|
||||
import org.apache.lucene.queries.function.valuesource.DoubleFieldSource;
|
||||
import org.apache.lucene.queries.function.valuesource.MultiValuedDoubleFieldSource;
|
||||
|
@ -36,8 +34,6 @@ import org.apache.lucene.util.BytesRefBuilder;
|
|||
import org.apache.lucene.util.NumericUtils;
|
||||
import org.apache.solr.search.QParser;
|
||||
import org.apache.solr.uninverting.UninvertingReader.Type;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* {@code PointField} implementation for {@code Double} values.
|
||||
|
@ -46,8 +42,6 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class DoublePointField extends PointField implements DoubleValueFieldType {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public DoublePointField() {
|
||||
type = NumberType.DOUBLE;
|
||||
}
|
||||
|
@ -171,12 +165,6 @@ public class DoublePointField extends PointField implements DoubleValueFieldType
|
|||
return new MultiValuedDoubleFieldSource(f.getName(), choice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LegacyNumericType getNumericType() {
|
||||
// TODO: refactor this to not use LegacyNumericType
|
||||
return LegacyNumericType.DOUBLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexableField createField(SchemaField field, Object value) {
|
||||
if (!isFieldUsed(field)) return null;
|
||||
|
|
|
@ -229,15 +229,6 @@ public class EnumField extends PrimitiveFieldType {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public LegacyNumericType getNumericType() {
|
||||
return LegacyNumericType.INT;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.apache.lucene.document.Field;
|
|||
import org.apache.lucene.document.SortedSetDocValuesField;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.legacy.LegacyNumericType;
|
||||
import org.apache.lucene.queries.function.ValueSource;
|
||||
import org.apache.lucene.search.BooleanClause;
|
||||
import org.apache.lucene.search.BooleanQuery;
|
||||
|
@ -610,16 +609,6 @@ public abstract class FieldType extends FieldProperties {
|
|||
return similarityFactory;
|
||||
}
|
||||
|
||||
|
||||
/** Return the numeric type of this field, or null if this field is not a
|
||||
* numeric field.
|
||||
* @deprecated Please use {@link FieldType#getNumberType()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public LegacyNumericType getNumericType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the numeric type of this field, or null if this field is not a
|
||||
* numeric field.
|
||||
|
|
|
@ -17,14 +17,12 @@
|
|||
|
||||
package org.apache.solr.schema;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.lucene.document.FloatPoint;
|
||||
import org.apache.lucene.document.StoredField;
|
||||
import org.apache.lucene.index.DocValuesType;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
import org.apache.lucene.legacy.LegacyNumericType;
|
||||
import org.apache.lucene.queries.function.ValueSource;
|
||||
import org.apache.lucene.queries.function.valuesource.FloatFieldSource;
|
||||
import org.apache.lucene.queries.function.valuesource.MultiValuedFloatFieldSource;
|
||||
|
@ -36,8 +34,6 @@ import org.apache.lucene.util.BytesRefBuilder;
|
|||
import org.apache.lucene.util.NumericUtils;
|
||||
import org.apache.solr.search.QParser;
|
||||
import org.apache.solr.uninverting.UninvertingReader.Type;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* {@code PointField} implementation for {@code Float} values.
|
||||
|
@ -46,8 +42,6 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class FloatPointField extends PointField implements FloatValueFieldType {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public FloatPointField() {
|
||||
type = NumberType.FLOAT;
|
||||
}
|
||||
|
@ -171,13 +165,6 @@ public class FloatPointField extends PointField implements FloatValueFieldType {
|
|||
return new MultiValuedFloatFieldSource(f.getName(), choice);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LegacyNumericType getNumericType() {
|
||||
// TODO: refactor this to not use LegacyNumericType
|
||||
return LegacyNumericType.FLOAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexableField createField(SchemaField field, Object value) {
|
||||
if (!isFieldUsed(field)) return null;
|
||||
|
|
|
@ -17,13 +17,11 @@
|
|||
|
||||
package org.apache.solr.schema;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.lucene.document.IntPoint;
|
||||
import org.apache.lucene.document.StoredField;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
import org.apache.lucene.legacy.LegacyNumericType;
|
||||
import org.apache.lucene.queries.function.ValueSource;
|
||||
import org.apache.lucene.queries.function.valuesource.IntFieldSource;
|
||||
import org.apache.lucene.queries.function.valuesource.MultiValuedIntFieldSource;
|
||||
|
@ -34,8 +32,6 @@ import org.apache.lucene.util.BytesRef;
|
|||
import org.apache.lucene.util.BytesRefBuilder;
|
||||
import org.apache.solr.search.QParser;
|
||||
import org.apache.solr.uninverting.UninvertingReader.Type;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* {@code PointField} implementation for {@code Integer} values.
|
||||
|
@ -44,8 +40,6 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class IntPointField extends PointField implements IntValueFieldType {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public IntPointField() {
|
||||
type = NumberType.INTEGER;
|
||||
}
|
||||
|
@ -163,11 +157,6 @@ public class IntPointField extends PointField implements IntValueFieldType {
|
|||
return new IntFieldSource(field.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public LegacyNumericType getNumericType() {
|
||||
return LegacyNumericType.INT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexableField createField(SchemaField field, Object value) {
|
||||
if (!isFieldUsed(field)) return null;
|
||||
|
|
|
@ -17,13 +17,11 @@
|
|||
|
||||
package org.apache.solr.schema;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.lucene.document.LongPoint;
|
||||
import org.apache.lucene.document.StoredField;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
import org.apache.lucene.legacy.LegacyNumericType;
|
||||
import org.apache.lucene.queries.function.ValueSource;
|
||||
import org.apache.lucene.queries.function.valuesource.LongFieldSource;
|
||||
import org.apache.lucene.queries.function.valuesource.MultiValuedLongFieldSource;
|
||||
|
@ -33,8 +31,6 @@ import org.apache.lucene.util.BytesRef;
|
|||
import org.apache.lucene.util.BytesRefBuilder;
|
||||
import org.apache.solr.search.QParser;
|
||||
import org.apache.solr.uninverting.UninvertingReader.Type;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* {@code PointField} implementation for {@code Long} values.
|
||||
|
@ -43,8 +39,6 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class LongPointField extends PointField implements LongValueFieldType {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public LongPointField() {
|
||||
type = NumberType.LONG;
|
||||
}
|
||||
|
@ -168,11 +162,6 @@ public class LongPointField extends PointField implements LongValueFieldType {
|
|||
return new MultiValuedLongFieldSource(field.getName(), choice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LegacyNumericType getNumericType() {
|
||||
return LegacyNumericType.LONG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexableField createField(SchemaField field, Object value) {
|
||||
if (!isFieldUsed(field)) return null;
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.apache.lucene.legacy.LegacyFieldType;
|
||||
import org.apache.lucene.legacy.LegacyNumericType;
|
||||
import org.apache.lucene.spatial.vector.PointVectorStrategy;
|
||||
|
||||
/**
|
||||
|
@ -79,12 +78,6 @@ public class SpatialPointVectorFieldType extends AbstractSpatialFieldType<PointV
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public LegacyNumericType getNumericType() {
|
||||
return LegacyNumericType.DOUBLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NumberType getNumberType() {
|
||||
return NumberType.DOUBLE;
|
||||
|
|
|
@ -336,23 +336,6 @@ public class TrieField extends NumericFieldType {
|
|||
return precisionStepArg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LegacyNumericType getNumericType() {
|
||||
switch (type) {
|
||||
case INTEGER:
|
||||
return LegacyNumericType.INT;
|
||||
case LONG:
|
||||
case DATE:
|
||||
return LegacyNumericType.LONG;
|
||||
case FLOAT:
|
||||
return LegacyNumericType.FLOAT;
|
||||
case DOUBLE:
|
||||
return LegacyNumericType.DOUBLE;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query getRangeQuery(QParser parser, SchemaField field, String min, String max, boolean minInclusive, boolean maxInclusive) {
|
||||
if (field.multiValued() && field.hasDocValues() && !field.indexed()) {
|
||||
|
|
Loading…
Reference in New Issue