Skip to content

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

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

pquentin
Copy link
Member

As an effort to reduce the delta between rest-api-spec and elasticsearch-specification.

@pquentin pquentin added >bug Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch :Search Foundations/Search Catch all for Search Foundations v9.0.0 v8.17.0 v8.18.0 labels Nov 22, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine
Copy link
Collaborator

Hi @pquentin, I've created a changelog YAML for you.

@pquentin pquentin requested a review from l-trotta November 22, 2024 10:45
@pquentin pquentin merged commit 2f8bb0b into elastic:main Nov 25, 2024
16 checks passed
@pquentin pquentin deleted the async-search-rest-api-spec branch November 25, 2024 07:43
@pquentin pquentin added the auto-backport Automatically create backport pull requests when merged label Nov 25, 2024
pquentin added a commit to pquentin/elasticsearch that referenced this pull request Nov 25, 2024
@pquentin
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.x
8.17

Questions ?

Please refer to the Backport tool documentation

pquentin added a commit to pquentin/elasticsearch that referenced this pull request Nov 25, 2024
@@ -126,6 +131,16 @@
"type":"string",
"description":"Specify the node or shard the operation should be performed on (default: random)"
},
"pre_filter_shard_size":{
Copy link
Member

@javanna javanna Nov 27, 2024

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.

Copy link
Member

@javanna javanna Nov 27, 2024

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?

Copy link
Member Author

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:

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants