Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/128153.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 128153
summary: "Fix: Add `NamedWriteable` for `RuleQueryRankDoc`"
area: Relevance
type: bug
issues:
- 126071
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.elasticsearch.plugins.SystemIndexPlugin;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestHandler;
import org.elasticsearch.search.rank.RankDoc;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.application.analytics.AnalyticsTemplateRegistry;
import org.elasticsearch.xpack.application.analytics.action.DeleteAnalyticsCollectionAction;
Expand Down Expand Up @@ -178,6 +179,7 @@
import org.elasticsearch.xpack.application.rules.action.TransportPutQueryRulesetAction;
import org.elasticsearch.xpack.application.rules.action.TransportTestQueryRulesetAction;
import org.elasticsearch.xpack.application.rules.retriever.QueryRuleRetrieverBuilder;
import org.elasticsearch.xpack.application.rules.retriever.RuleQueryRankDoc;
import org.elasticsearch.xpack.application.search.SearchApplicationIndexService;
import org.elasticsearch.xpack.application.search.action.DeleteSearchApplicationAction;
import org.elasticsearch.xpack.application.search.action.GetSearchApplicationAction;
Expand Down Expand Up @@ -358,6 +360,11 @@ public List<ActionHandler> getActions() {
return Collections.unmodifiableList(actionHandlers);
}

@Override
public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
return List.of(new NamedWriteableRegistry.Entry(RankDoc.class, RuleQueryRankDoc.NAME, RuleQueryRankDoc::new));
}

@Override
public List<RestHandler> getRestHandlers(
Settings settings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,18 @@ teardown:
- do:
indices.create:
index: test-index-001
body:
settings:
index:
number_of_shards: 5 # Ensure more shards than docs

- do:
indices.create:
index: test-index-002
body:
settings:
index:
number_of_shards: 5 # Ensure more shards than docs

- do:
bulk:
Expand Down Expand Up @@ -949,6 +957,7 @@ teardown:

- do:
search:
index: test-index-001,test-index-002
body:
retriever:
rule:
Expand Down
Loading