Skip to content

Support different routing for each id in multiget #1954

Closed
@mateog5

Description

@mateog5

Multiget doesn't support different routing for each id

public Flux<MultiGetItem> multiGet(Query query, Class clazz, IndexCoordinates index)
-->
private List<MultiGetRequest.Item> getMultiRequestItems(Query searchQuery, Class<?> clazz, IndexCoordinates index)

for (String id : searchQuery.getIds()) {
   MultiGetRequest.Item item = new MultiGetRequest.Item(indexName, id);

  if (searchQuery.getRoute() != null) {
	item = item.routing(searchQuery.getRoute());
  }
....

Currently is only possible to set same routing for all ids

GET index-search/_mget
{
"docs": [
{
"_type": "_doc",
"_id": "xxxx",
"routing": "routingForXXXX, routingForYYYY"
},
{
"_type": "_doc",
"_id": "yyyy",
"routing": "routingForXXXX, routingForYYYY"

}

]
}

Should be possible to set different routing for each id

GET index-search/_mget
{
"docs": [
{
"_type": "_doc",
"_id": "xxxx",
"routing": "routingForXXX"
},
{
"_type": "_doc",
"_id": "yyyy",
"routing": "routingForYYYY"

}

]
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions