mirror of
https://github.com/apache/lucene.git
synced 2025-03-03 06:49:38 +00:00
LUCENE-9340: Remove deprecated SimpleBindings#add(SortField) method
This commit is contained in:
parent
f6462ee350
commit
5eb117f561
@ -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 across
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DoubleValuesSource getDoubleValuesSource(String name) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user