-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a class to hold field capabilities for one index. #51721
Conversation
Pinging @elastic/es-search (:Search/Mapping) |
in.readOptionalStringArray(); | ||
} | ||
|
||
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The serialization turned out to be a bit messy unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change makes sense to me, the bwc path is a bit difficult to read (we serialize IndexFieldCapabilities
as FieldCapabilities
for nodes < 8) but I don't have a better idea to simplify.
Thanks @jimczi for the review.
I pushed a change to the serialization logic to make this clearer, I'm curious if you find it better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks better to me, thanks @jtibshirani
Currently, the same class
FieldCapabilities
is used both to represent thecapabilities for one index, and also the merged capabilities across indices. To
help clarify the logic, this PR proposes to create a separate class
IndexFieldCapabilities
for the capabilities in one index. The refactor willalso help when adding
source_path
information in #49264, since the mergedsource path field will have a different structure from the field for a single index.
Individual changes: