remove ParseFieldMatcher usages from SearchAfterBuilder
This commit is contained in:
parent
723bdc4549
commit
d87a30647b
|
@ -1061,7 +1061,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
|
|||
} else if (_SOURCE_FIELD.match(currentFieldName)) {
|
||||
fetchSourceContext = FetchSourceContext.fromXContent(context.parser());
|
||||
} else if (SEARCH_AFTER.match(currentFieldName)) {
|
||||
searchAfterBuilder = SearchAfterBuilder.fromXContent(parser, context.getParseFieldMatcher());
|
||||
searchAfterBuilder = SearchAfterBuilder.fromXContent(parser);
|
||||
} else if (FIELDS_FIELD.match(currentFieldName)) {
|
||||
throw new ParsingException(parser.getTokenLocation(), "The field [" +
|
||||
SearchSourceBuilder.FIELDS_FIELD + "] is no longer supported, please use [" +
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.apache.lucene.search.FieldDoc;
|
|||
import org.apache.lucene.search.SortField;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.ParseFieldMatcher;
|
||||
import org.elasticsearch.common.ParsingException;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
|
@ -202,7 +201,7 @@ public class SearchAfterBuilder implements ToXContent, Writeable {
|
|||
builder.array(SEARCH_AFTER.getPreferredName(), sortValues);
|
||||
}
|
||||
|
||||
public static SearchAfterBuilder fromXContent(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws IOException {
|
||||
public static SearchAfterBuilder fromXContent(XContentParser parser) throws IOException {
|
||||
SearchAfterBuilder builder = new SearchAfterBuilder();
|
||||
XContentParser.Token token = parser.currentToken();
|
||||
List<Object> values = new ArrayList<> ();
|
||||
|
|
|
@ -133,7 +133,7 @@ public class SearchAfterBuilderTests extends ESTestCase {
|
|||
parser.nextToken();
|
||||
parser.nextToken();
|
||||
parser.nextToken();
|
||||
return SearchAfterBuilder.fromXContent(parser, null);
|
||||
return SearchAfterBuilder.fromXContent(parser);
|
||||
}
|
||||
|
||||
private static SearchAfterBuilder serializedCopy(SearchAfterBuilder original) throws IOException {
|
||||
|
@ -172,7 +172,7 @@ public class SearchAfterBuilderTests extends ESTestCase {
|
|||
parser.nextToken();
|
||||
parser.nextToken();
|
||||
parser.nextToken();
|
||||
SearchAfterBuilder secondSearchAfterBuilder = SearchAfterBuilder.fromXContent(parser, null);
|
||||
SearchAfterBuilder secondSearchAfterBuilder = SearchAfterBuilder.fromXContent(parser);
|
||||
assertNotSame(searchAfterBuilder, secondSearchAfterBuilder);
|
||||
assertEquals(searchAfterBuilder, secondSearchAfterBuilder);
|
||||
assertEquals(searchAfterBuilder.hashCode(), secondSearchAfterBuilder.hashCode());
|
||||
|
|
|
@ -302,7 +302,7 @@ public class RandomSearchRequestGenerator {
|
|||
parser.nextToken();
|
||||
parser.nextToken();
|
||||
parser.nextToken();
|
||||
builder.searchAfter(SearchAfterBuilder.fromXContent(parser, null).getSortValues());
|
||||
builder.searchAfter(SearchAfterBuilder.fromXContent(parser).getSortValues());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Error building search_from", e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue