-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
[Rest Api Compatibility] Typed endpoints for search and related endpoints #72155
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Pinging @elastic/es-search (Team:Search) |
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.
LGTM from a search perspective.
@@ -120,6 +129,12 @@ public static void parseSearchRequest(SearchRequest searchRequest, RestRequest r | |||
XContentParser requestContentParser, | |||
NamedWriteableRegistry namedWriteableRegistry, | |||
IntConsumer setSize) throws IOException { | |||
if (request.getRestApiVersion() == RestApiVersion.V_7 && | |||
(request.hasParam(INCLUDE_TYPE_NAME_PARAMETER) || request.hasParam("type"))) { |
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.
Does include_type_name
actually have an effect here?
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.
good point, it is not needed. I mistakenly assumed that it is needed as other APIs so far were expecting it.
I removed it
//possibly this needs a separate issue to track the problem | ||
// if we emit a compatible warning when a type parameter (?type=some_type) is present, | ||
// then for APIs where a {type} is used a compatible warning would be emitted twice | ||
// this is because we cannot distinguish between them and for {type} we already emit a warning when using a Route |
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.
I think this is fine? If you specify the type in two places you get two warnings.
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.
I probably did not made this clear. The problem is that you would get two warnings when specifying the type in {type} as in path.
The problem only occurs when an expected paramter ?type has the same name as the parameter in braces {type}
enabeling the tests and adds a type field for termvector response the commit that enabled typed enpoints but missed to update the response elastic#72155
Enabling the tests and adds a type field for termvector response the commit that enabled typed endpoints but missed to update the response #72155
Implements a V7 compatible typed endpoints for REST for search related apis
retrofits the REST layer change removed in #41640
relates main meta issue #51816
relates types removal issue #54160