Remove types from percolate query API#46985
Conversation
|
Pinging @elastic/es-search |
|
@elasticsearch update branch |
|
@elasticmachine update branch |
|
@elasticmachine run elasticsearch-ci/bwc |
|
@elasticmachine run elasticsearch-ci/2 |
|
This ILM test keeps failing, but it seems to be completely unrelated and doesn't reproduce locally for me at all: @elasticmachine run elasticsearch-ci/2 |
| this(field, Collections.singletonList(document), documentXContentType); | ||
| } | ||
|
|
||
| private PercolateQueryBuilder(String field, BytesReference document) { |
There was a problem hiding this comment.
I think this constructor is unused.
| String testName = "name1"; | ||
| QueryShardContext shardContext = createShardContext(); | ||
| PercolateQueryBuilder percolateQueryBuilder = new PercolateQueryBuilder(queryField, null, supplier); | ||
| PercolateQueryBuilder percolateQueryBuilder = new PercolateQueryBuilder(queryField, supplier::get); |
There was a problem hiding this comment.
Super small comment, could this just be new PercolateQueryBuilder(queryField, supplier)?
| field = in.readString(); | ||
| name = in.readOptionalString(); | ||
| documentType = in.readOptionalString(); | ||
| if (in.getVersion().before(Version.V_8_0_0)) { |
There was a problem hiding this comment.
For this query type, a 7.x 'typeless' query is represented by a null documentType and indexedDocumentType. So I think that here and in doWriteTo, we should always assume these parameters are null instead of _doc.
| out.writeOptionalString(name); | ||
| out.writeOptionalString(documentType); | ||
| if (out.getVersion().before(Version.V_8_0_0)) { | ||
| out.writeOptionalString(MapperService.SINGLE_MAPPING_NAME); |
There was a problem hiding this comment.
Related to my comment on the previous revision, I think we should write null here. In 7.x, a 'typeless' percolate query is represented by a null documentType and indexedDocumentType.
Previously removed in elastic#46985. The yaml test is included in this PR, but will be removed once elastic#74689 is merged.
Relates to #41059