Skip to content

Commit cb4728d

Browse files
authored
[9.0] Fix: Add NamedWriteable for RuleQueryRankDoc (#128153) (#128265)
* Fix: Add NamedWriteable for RuleQueryRankDoc (#128153) * Add NamedWriteable for QueryRule rank doc * Update test * Update docs/changelog/128153.yaml * Add multi cluster test for query rules * Commenting out code - explicitly trying to spur a test failure * [CI] Auto commit changes from spotless * Streamline test for multi cluster * Revert changes to try to break test * Fix compile error --------- Co-authored-by: elasticsearchmachine <[email protected]> (cherry picked from commit b335c1a) # Conflicts: # x-pack/plugin/ent-search/src/yamlRestTest/resources/rest-api-spec/test/entsearch/rules/40_rule_query_search.yml * Update 40_rule_query_search.yml Remove test that can't run in < 9.1
1 parent 50c14b8 commit cb4728d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docs/changelog/128153.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 128153
2+
summary: "Fix: Add `NamedWriteable` for `RuleQueryRankDoc`"
3+
area: Relevance
4+
type: bug
5+
issues:
6+
- 126071

x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/EnterpriseSearch.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.elasticsearch.plugins.SystemIndexPlugin;
3131
import org.elasticsearch.rest.RestController;
3232
import org.elasticsearch.rest.RestHandler;
33+
import org.elasticsearch.search.rank.RankDoc;
3334
import org.elasticsearch.xcontent.ParseField;
3435
import org.elasticsearch.xpack.application.analytics.AnalyticsTemplateRegistry;
3536
import org.elasticsearch.xpack.application.analytics.action.DeleteAnalyticsCollectionAction;
@@ -179,6 +180,7 @@
179180
import org.elasticsearch.xpack.application.rules.action.TransportPutQueryRulesetAction;
180181
import org.elasticsearch.xpack.application.rules.action.TransportTestQueryRulesetAction;
181182
import org.elasticsearch.xpack.application.rules.retriever.QueryRuleRetrieverBuilder;
183+
import org.elasticsearch.xpack.application.rules.retriever.RuleQueryRankDoc;
182184
import org.elasticsearch.xpack.application.search.SearchApplicationIndexService;
183185
import org.elasticsearch.xpack.application.search.action.DeleteSearchApplicationAction;
184186
import org.elasticsearch.xpack.application.search.action.GetSearchApplicationAction;
@@ -351,6 +353,11 @@ protected XPackLicenseState getLicenseState() {
351353
return Collections.unmodifiableList(actionHandlers);
352354
}
353355

356+
@Override
357+
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
358+
return List.of(new NamedWriteableRegistry.Entry(RankDoc.class, RuleQueryRankDoc.NAME, RuleQueryRankDoc::new));
359+
}
360+
354361
@Override
355362
public List<RestHandler> getRestHandlers(
356363
Settings settings,

0 commit comments

Comments
 (0)