mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Remove (read|write)SortBuilder
This commit is contained in:
parent
38721ecf7b
commit
52f7c20344
@ -28,7 +28,6 @@ import org.apache.lucene.util.BitUtil;
|
|||||||
import org.apache.lucene.util.BytesRef;
|
import org.apache.lucene.util.BytesRef;
|
||||||
import org.apache.lucene.util.CharsRefBuilder;
|
import org.apache.lucene.util.CharsRefBuilder;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommand;
|
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
@ -37,8 +36,6 @@ import org.elasticsearch.common.geo.GeoPoint;
|
|||||||
import org.elasticsearch.common.text.Text;
|
import org.elasticsearch.common.text.Text;
|
||||||
import org.elasticsearch.index.query.QueryBuilder;
|
import org.elasticsearch.index.query.QueryBuilder;
|
||||||
import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder;
|
import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder;
|
||||||
import org.elasticsearch.search.DocValueFormat;
|
|
||||||
import org.elasticsearch.search.sort.SortBuilder;
|
|
||||||
import org.elasticsearch.search.suggest.SuggestionBuilder;
|
import org.elasticsearch.search.suggest.SuggestionBuilder;
|
||||||
import org.elasticsearch.search.suggest.phrase.SmoothingModel;
|
import org.elasticsearch.search.suggest.phrase.SmoothingModel;
|
||||||
import org.elasticsearch.tasks.Task;
|
import org.elasticsearch.tasks.Task;
|
||||||
@ -754,15 +751,6 @@ public abstract class StreamInput extends InputStream {
|
|||||||
return readNamedWriteable(SuggestionBuilder.class);
|
return readNamedWriteable(SuggestionBuilder.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reads a {@link SortBuilder} from the current stream
|
|
||||||
* @deprecated prefer {@link #readNamedWriteable(Class)} passing {@link SortBuilder}.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public SortBuilder<?> readSortBuilder() throws IOException {
|
|
||||||
return readNamedWriteable(SortBuilder.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a {@link org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder} from the current stream
|
* Reads a {@link org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder} from the current stream
|
||||||
* @deprecated prefer {@link #readNamedWriteable(Class)} passing {@link ScoreFunctionBuilder}.
|
* @deprecated prefer {@link #readNamedWriteable(Class)} passing {@link ScoreFunctionBuilder}.
|
||||||
|
@ -29,15 +29,12 @@ import org.apache.lucene.util.BytesRef;
|
|||||||
import org.apache.lucene.util.BytesRefBuilder;
|
import org.apache.lucene.util.BytesRefBuilder;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommand;
|
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.geo.GeoPoint;
|
import org.elasticsearch.common.geo.GeoPoint;
|
||||||
import org.elasticsearch.common.text.Text;
|
import org.elasticsearch.common.text.Text;
|
||||||
import org.elasticsearch.index.query.QueryBuilder;
|
import org.elasticsearch.index.query.QueryBuilder;
|
||||||
import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder;
|
import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder;
|
||||||
import org.elasticsearch.search.DocValueFormat;
|
|
||||||
import org.elasticsearch.search.sort.SortBuilder;
|
|
||||||
import org.elasticsearch.search.suggest.SuggestionBuilder;
|
import org.elasticsearch.search.suggest.SuggestionBuilder;
|
||||||
import org.elasticsearch.search.suggest.phrase.SmoothingModel;
|
import org.elasticsearch.search.suggest.phrase.SmoothingModel;
|
||||||
import org.elasticsearch.tasks.Task;
|
import org.elasticsearch.tasks.Task;
|
||||||
@ -781,13 +778,4 @@ public abstract class StreamOutput extends OutputStream {
|
|||||||
public void writeSuggestion(SuggestionBuilder<?> suggestion) throws IOException {
|
public void writeSuggestion(SuggestionBuilder<?> suggestion) throws IOException {
|
||||||
writeNamedWriteable(suggestion);
|
writeNamedWriteable(suggestion);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a {@link SortBuilder} to the current stream
|
|
||||||
* @deprecated prefer {@link #writeNamedWriteable(NamedWriteable)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void writeSortBuilder(SortBuilder<?> sort) throws IOException {
|
|
||||||
writeNamedWriteable(sort);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
|
|||||||
int size = in.readVInt();
|
int size = in.readVInt();
|
||||||
sorts = new ArrayList<>(size);
|
sorts = new ArrayList<>(size);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
sorts.add(in.readSortBuilder());
|
sorts.add(in.readNamedWriteable(SortBuilder.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
highlightBuilder = in.readOptionalWriteable(HighlightBuilder::new);
|
highlightBuilder = in.readOptionalWriteable(HighlightBuilder::new);
|
||||||
@ -191,7 +191,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
|
|||||||
if (hasSorts) {
|
if (hasSorts) {
|
||||||
out.writeVInt(sorts.size());
|
out.writeVInt(sorts.size());
|
||||||
for (SortBuilder<?> sort : sorts) {
|
for (SortBuilder<?> sort : sorts) {
|
||||||
out.writeSortBuilder(sort);
|
out.writeNamedWriteable(sort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.writeOptionalWriteable(highlightBuilder);
|
out.writeOptionalWriteable(highlightBuilder);
|
||||||
|
@ -106,7 +106,7 @@ public class TopHitsAggregatorBuilder extends AggregatorBuilder<TopHitsAggregato
|
|||||||
int size = in.readVInt();
|
int size = in.readVInt();
|
||||||
sorts = new ArrayList<>();
|
sorts = new ArrayList<>();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
sorts.add(in.readSortBuilder());
|
sorts.add(in.readNamedWriteable(SortBuilder.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
trackScores = in.readBoolean();
|
trackScores = in.readBoolean();
|
||||||
@ -149,7 +149,7 @@ public class TopHitsAggregatorBuilder extends AggregatorBuilder<TopHitsAggregato
|
|||||||
if (hasSorts) {
|
if (hasSorts) {
|
||||||
out.writeVInt(sorts.size());
|
out.writeVInt(sorts.size());
|
||||||
for (SortBuilder<?> sort : sorts) {
|
for (SortBuilder<?> sort : sorts) {
|
||||||
out.writeSortBuilder(sort);
|
out.writeNamedWriteable(sort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.writeBoolean(trackScores);
|
out.writeBoolean(trackScores);
|
||||||
|
@ -241,7 +241,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
|
|||||||
int size = in.readVInt();
|
int size = in.readVInt();
|
||||||
sorts = new ArrayList<>();
|
sorts = new ArrayList<>();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
sorts.add(in.readSortBuilder());
|
sorts.add(in.readNamedWriteable(SortBuilder.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
@ -345,7 +345,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
|
|||||||
if (hasSorts) {
|
if (hasSorts) {
|
||||||
out.writeVInt(sorts.size());
|
out.writeVInt(sorts.size());
|
||||||
for (SortBuilder<?> sort : sorts) {
|
for (SortBuilder<?> sort : sorts) {
|
||||||
out.writeSortBuilder(sort);
|
out.writeNamedWriteable(sort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean hasStats = stats != null;
|
boolean hasStats = stats != null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user