Apache Solr open-source search software
LUCENE-9340: Remove deprecated SimpleBindings#add(SortField) method
Alan Woodward5eb117f561ab
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex b801241259e..c4554490bb2 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -56,6 +56,8 @@ API Changes* LUCENE-9307: BufferedIndexInput#setBufferSize has been removed. (Adrien Grand)+* LUCENE-9340: SimpleBindings#add(SortField) has been removed. (Alan Woodward)+Improvements* LUCENE-8757: When provided with an ExecutorService to run queries acrossdiff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/SimpleBindings.java b/lucene/expressions/src/java/org/apache/lucene/expressions/SimpleBindings.javaindex 1b8e06551eb..ee888a8b651 100644--- a/lucene/expressions/src/java/org/apache/lucene/expressions/SimpleBindings.java+++ b/lucene/expressions/src/java/org/apache/lucene/expressions/SimpleBindings.java@@ -24,7 +24,6 @@ import java.util.Set;import java.util.function.Function;import org.apache.lucene.search.DoubleValuesSource;-import org.apache.lucene.search.SortField;/*** Simple class that binds expression variable names to {@link DoubleValuesSource}s@@ -52,20 +51,6 @@ public final class SimpleBindings extends Bindings {/** Creates a new empty Bindings */public SimpleBindings() {}-- /**- * Adds a SortField to the bindings.- *- * @see DoubleValuesSource#fromIntField(String)- * @see DoubleValuesSource#fromLongField(String)- * @see DoubleValuesSource#fromFloatField(String)- * @see DoubleValuesSource#fromDoubleField(String)- * @see DoubleValuesSource#SCORES- */- @Deprecated- public void add(SortField sortField) {- map.put(sortField.getField(), bindings -> fromSortField(sortField));- }/*** Bind a {@link DoubleValuesSource} directly to the given name.@@ -80,23 +65,6 @@ public final class SimpleBindings extends Bindings {public void add(String name, Expression expression) {map.put(name, expression::getDoubleValuesSource);}-- private DoubleValuesSource fromSortField(SortField field) {- switch(field.getType()) {- case INT:- return DoubleValuesSource.fromIntField(field.getField());- case LONG:- return DoubleValuesSource.fromLongField(field.getField());- case FLOAT:- return DoubleValuesSource.fromFloatField(field.getField());- case DOUBLE:- return DoubleValuesSource.fromDoubleField(field.getField());- case SCORE:- return DoubleValuesSource.SCORES;- default:- throw new UnsupportedOperationException();- }- }@Overridepublic DoubleValuesSource getDoubleValuesSource(String name) {