-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Add missing async_search query parameters to rest-api-spec #117312
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
Conversation
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
Hi @pquentin, I've created a changelog YAML for you. |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
@@ -126,6 +131,16 @@ | |||
"type":"string", | |||
"description":"Specify the node or shard the operation should be performed on (default: random)" | |||
}, | |||
"pre_filter_shard_size":{ |
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 am not sure this is correct: see https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchAction.java#L62 .
Do we have a test that verifies that pre_filter_shard_size can be set via async search. I would think that should throw an error.
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.
Could you next time please wait for a member of the team that the PR is tagged with, in this case Search Foundations, to review it before merging?
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.
Sorry about that. I'll wait for a team review next time. There's indeed a test:
Lines 120 to 127 in 2ed318f
public void testValidatePreFilterShardSize() { | |
SubmitAsyncSearchRequest req = new SubmitAsyncSearchRequest(); | |
req.getSearchRequest().setPreFilterShardSize(randomIntBetween(2, Integer.MAX_VALUE)); | |
ActionRequestValidationException exc = req.validate(); | |
assertNotNull(exc); | |
assertThat(exc.validationErrors().size(), equalTo(1)); | |
assertThat(exc.validationErrors().get(0), containsString("[pre_filter_shard_size]")); | |
} |
I opened #117626 to fix it.
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.
That test is a unit test around the internal behaviour. What I meant is that the only way to really know that a REST parameter is supported, is to add a quick yaml test that provides it. I am assuming this would not have worked in this PR, as the parameter is not accepted.
As an effort to reduce the delta between rest-api-spec and elasticsearch-specification.