|
43 | 43 | import org.elasticsearch.common.io.stream.NamedWriteableRegistry; |
44 | 44 | import org.elasticsearch.common.io.stream.StreamInput; |
45 | 45 | import org.elasticsearch.common.io.stream.StreamOutput; |
46 | | -import org.elasticsearch.common.logging.DeprecationLogger; |
47 | 46 | import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; |
48 | 47 | import org.elasticsearch.common.xcontent.XContentHelper; |
49 | 48 | import org.elasticsearch.index.IndexVersion; |
|
80 | 79 | import java.util.Collections; |
81 | 80 | import java.util.List; |
82 | 81 | import java.util.Objects; |
83 | | -import java.util.function.BiConsumer; |
84 | 82 | import java.util.function.Supplier; |
85 | 83 |
|
86 | 84 | import static org.elasticsearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES; |
87 | 85 | import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; |
88 | 86 | import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; |
89 | 87 |
|
90 | 88 | public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBuilder> { |
91 | | - private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ParseField.class); |
92 | | - static final String DOCUMENT_TYPE_DEPRECATION_MESSAGE = "[types removal] Types are deprecated in [percolate] queries. " |
93 | | - + "The [document_type] should no longer be specified."; |
94 | | - static final String TYPE_DEPRECATION_MESSAGE = "[types removal] Types are deprecated in [percolate] queries. " |
95 | | - + "The [type] of the indexed document should no longer be specified."; |
96 | | - |
97 | 89 | public static final String NAME = "percolate"; |
98 | 90 |
|
99 | 91 | static final ParseField DOCUMENT_FIELD = new ParseField("document"); |
100 | 92 | static final ParseField DOCUMENTS_FIELD = new ParseField("documents"); |
101 | 93 | private static final ParseField NAME_FIELD = new ParseField("name"); |
102 | 94 | private static final ParseField QUERY_FIELD = new ParseField("field"); |
103 | | - private static final ParseField DOCUMENT_TYPE_FIELD = new ParseField("document_type"); |
104 | | - private static final ParseField INDEXED_DOCUMENT_FIELD_TYPE = new ParseField("type"); |
105 | 95 | private static final ParseField INDEXED_DOCUMENT_FIELD_INDEX = new ParseField("index"); |
106 | 96 | private static final ParseField INDEXED_DOCUMENT_FIELD_ID = new ParseField("id"); |
107 | 97 | private static final ParseField INDEXED_DOCUMENT_FIELD_ROUTING = new ParseField("routing"); |
@@ -368,10 +358,6 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep |
368 | 358 | ); |
369 | 359 | } |
370 | 360 |
|
371 | | - private static BiConsumer<PercolateQueryBuilder, String> deprecateAndIgnoreType(String key, String message) { |
372 | | - return (target, type) -> deprecationLogger.compatibleCritical(key, message); |
373 | | - } |
374 | | - |
375 | 361 | private static BytesReference parseDocument(XContentParser parser) throws IOException { |
376 | 362 | try (XContentBuilder builder = XContentFactory.jsonBuilder()) { |
377 | 363 | builder.copyCurrentStructure(parser); |
|
0 commit comments