Remove (read|write)SortBuilder

This commit is contained in:
Nik Everett 2016-04-18 19:51:39 -04:00
parent 38721ecf7b
commit 52f7c20344
5 changed files with 6 additions and 30 deletions

View File

@ -28,7 +28,6 @@ import org.apache.lucene.util.BitUtil;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.CharsRefBuilder;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommand;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Strings;
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.index.query.QueryBuilder;
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.phrase.SmoothingModel;
import org.elasticsearch.tasks.Task;
@ -754,15 +751,6 @@ public abstract class StreamInput extends InputStream {
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
* @deprecated prefer {@link #readNamedWriteable(Class)} passing {@link ScoreFunctionBuilder}.

View File

@ -29,15 +29,12 @@ import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommand;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.text.Text;
import org.elasticsearch.index.query.QueryBuilder;
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.phrase.SmoothingModel;
import org.elasticsearch.tasks.Task;
@ -781,13 +778,4 @@ public abstract class StreamOutput extends OutputStream {
public void writeSuggestion(SuggestionBuilder<?> suggestion) throws IOException {
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);
}
}

View File

@ -160,7 +160,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
int size = in.readVInt();
sorts = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
sorts.add(in.readSortBuilder());
sorts.add(in.readNamedWriteable(SortBuilder.class));
}
}
highlightBuilder = in.readOptionalWriteable(HighlightBuilder::new);
@ -191,7 +191,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
if (hasSorts) {
out.writeVInt(sorts.size());
for (SortBuilder<?> sort : sorts) {
out.writeSortBuilder(sort);
out.writeNamedWriteable(sort);
}
}
out.writeOptionalWriteable(highlightBuilder);

View File

@ -106,7 +106,7 @@ public class TopHitsAggregatorBuilder extends AggregatorBuilder<TopHitsAggregato
int size = in.readVInt();
sorts = new ArrayList<>();
for (int i = 0; i < size; i++) {
sorts.add(in.readSortBuilder());
sorts.add(in.readNamedWriteable(SortBuilder.class));
}
}
trackScores = in.readBoolean();
@ -149,7 +149,7 @@ public class TopHitsAggregatorBuilder extends AggregatorBuilder<TopHitsAggregato
if (hasSorts) {
out.writeVInt(sorts.size());
for (SortBuilder<?> sort : sorts) {
out.writeSortBuilder(sort);
out.writeNamedWriteable(sort);
}
}
out.writeBoolean(trackScores);

View File

@ -241,7 +241,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
int size = in.readVInt();
sorts = new ArrayList<>();
for (int i = 0; i < size; i++) {
sorts.add(in.readSortBuilder());
sorts.add(in.readNamedWriteable(SortBuilder.class));
}
}
if (in.readBoolean()) {
@ -345,7 +345,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
if (hasSorts) {
out.writeVInt(sorts.size());
for (SortBuilder<?> sort : sorts) {
out.writeSortBuilder(sort);
out.writeNamedWriteable(sort);
}
}
boolean hasStats = stats != null;