-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
SearchHit explicitly saves and uses source content-type #104903
base: main
Are you sure you want to change the base?
Conversation
Pinging @elastic/es-search (Team:Search) |
hey @ldematte having worked a long time ago on the deprecation of content type guessing, what is the plan for removing that for source? If I remember correctly there are places where we don't store the content type and we have no other way than guessing it? |
Hey @javanna, thanks for taking a look. Currently, when we are writing out source, we use Today a SearchHit may have a valid For the first one, we can transmit the content-type too, adding it to the protocol (from now on) and fallback to guessing it when it's not present (older nodes/protocol).
Looking at |
Thanks @ldematte I am ok with the current scope. I wanted to see what the high-level plan was, and I think there is still an issue around the fact that we don't store the source content type in all places. Certainly content type guessing from SearchHit itself can be removed with this PR. |
I agree with you @javanna: this is only a small bit, by no means I would consider the issue solved. Nothing has changed high-level I'm afraid, I only happened across this bit doing related work, so the scope is quite limited. |
source
is passed as a BytesReference, but then its original content type is required to write out XContent and it needs to be inferred - which is deprecated across several functions.This PR adds a content type parameter whenever a source is specified or set in a SearchHit.
This preliminary work will make "chunkification" of the missing bits of SearchHit response (the
source
field, missing from #104770) simpler and more efficient.