Skip to content

Commit

Permalink
Fix tests and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed Apr 23, 2024
1 parent 4fa5392 commit ec0a3f7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ GET /my-index-000001/_search
// TEST[setup:my_index]

[discrete]
[[expand-collapse-results]]
[[rescore-collapse-results]]
==== Rescore collapse results

You can use field collapsing alongside the <<rescore, `rescore`>> search parameter.
Expand Down
1 change: 1 addition & 0 deletions rest-api-spec/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task ->
task.skipTest("search/370_profile/fetch source", "profile output has changed")
task.skipTest("search/370_profile/fetch nested source", "profile output has changed")
task.skipTest("search/240_date_nanos/doc value fields are working as expected across date and date_nanos fields", "Fetching docvalues field multiple times is no longer allowed")
task.skipTest("search/110_field_collapsing/field collapsing and rescore", "#107779 Field collapsing is compatible with rescore in 8.15")

task.replaceValueInMatch("_type", "_doc")
task.addAllowedWarningRegex("\\[types removal\\].*")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,6 @@ public void testValidate() throws IOException {
assertEquals(1, validationErrors.validationErrors().size());
assertEquals("[slice] can only be used with [scroll] or [point-in-time] requests", validationErrors.validationErrors().get(0));
}
{
// collapse and rescore
SearchRequest searchRequest = createSearchRequest().source(new SearchSourceBuilder());
searchRequest.scroll((Scroll) null);
searchRequest.source().collapse(new CollapseBuilder("field"));
searchRequest.source().addRescorer(new QueryRescorerBuilder(new MatchAllQueryBuilder()));
ActionRequestValidationException validationErrors = searchRequest.validate();
assertNotNull(validationErrors);
assertEquals(1, validationErrors.validationErrors().size());
assertEquals("cannot use `collapse` in conjunction with `rescore`", validationErrors.validationErrors().get(0));
}
{
// stored fields disabled with _source requested
SearchRequest searchRequest = createSearchRequest().source(new SearchSourceBuilder());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2187,13 +2187,6 @@ public void testParseSourceValidation() {
service
);
}
{
// collapse and rescore
SearchRequest searchRequest = new SearchRequest().source(new SearchSourceBuilder());
searchRequest.source().collapse(new CollapseBuilder("field"));
searchRequest.source().addRescorer(new QueryRescorerBuilder(new MatchAllQueryBuilder()));
assertCreateContextValidation(searchRequest, "cannot use `collapse` in conjunction with `rescore`", indexService, service);
}
{
// stored fields disabled with _source requested
SearchRequest searchRequest = new SearchRequest().source(new SearchSourceBuilder());
Expand Down

0 comments on commit ec0a3f7

Please sign in to comment.