Add percolator field fallback compatibility#137466
Conversation
|
@javanna I'm just looking for some validation that I'm either going in the right direction, or completely off course here :) As we discussed, this is to address that fact that if folks have already upgraded from 8.x to 9.x, and have older indices with percolator fields, we need a way to avoid breaking those folks. |
rjernst
left a comment
There was a problem hiding this comment.
Could you add a unit test that trips the fallback case?
modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java
Outdated
Show resolved
Hide resolved
Yes. Wanted to get a some confirmation that this approach was reasonable. |
andreidan
left a comment
There was a problem hiding this comment.
Thanks for working on this Mark.
This has the right sort of shape for what we need. I think it's going in the right direction.
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
|
I've updated the existing |
jdconrad
left a comment
There was a problem hiding this comment.
LGTM! Just left one small question.
| assert valueLength > 0; | ||
|
|
||
| TransportVersion transportVersion; | ||
| if (indexVersion.before(IndexVersions.V_8_8_0)) { |
There was a problem hiding this comment.
I assume when we remove all versions prior to V_8_8_0 this if/else just becomes the else in a safe way now since it'll either reload from source or reject if there is no source?
There was a problem hiding this comment.
This is IndexVersion so this won't go away until ES 10.
Introduce a "fallback" mechanism to read query builders from percolator fields from source, rather than from the binary field value. This may be necessary in certain cases if the documents were originally ingested with a earlier version of Elasticsearch for which transport serialization compatibility has been removed. In this case the queries can still work, albeit less efficiently. When we do this we emit a warning instructing that users reindex to avoid this additional overhead.