You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently field routing will route a record to a row during the indexing phase. However, when we are querying it, it expects the user to provide the routing= parameter, ignoring the field appearing in the query. if no routing parameter, the request will reach all shards.
Please improve the field routing feature to automatically detect the routing number from the query such that if the field value appeared in the query, automatically take that value as the routing key.
Example:
we have a index "videos" defined with routing on "account_id" field:
"videos": {
"_routing": {
"required": true,
"path": "account_id"
},
"properties": {
"account_id": {
"type": "integer",
"ignore_malformed": false
},
"text": {
"type": "string",
"analyzer": "simple"
},
...
The search request is routed to the shards that need to handle the request before the query is parsed. In fact, we're discussing removing support for the _routing path in #6730. On top of that, multi-index, multi-type queries with potentially many different analyzer configurations would make this automatic routing a nightmare to implement and debug.
If you know what field should be used for routing, why not extract it in your application and use it as a routing value to the query? Seems a lot simpler than trying to get it right within something as complex as the query dsl.
Currently field routing will route a record to a row during the indexing phase. However, when we are querying it, it expects the user to provide the routing= parameter, ignoring the field appearing in the query. if no routing parameter, the request will reach all shards.
Please improve the field routing feature to automatically detect the routing number from the query such that if the field value appeared in the query, automatically take that value as the routing key.
Example:
we have a index "videos" defined with routing on "account_id" field:
"videos": {
"_routing": {
"required": true,
"path": "account_id"
},
"properties": {
"account_id": {
"type": "integer",
"ignore_malformed": false
},
"text": {
"type": "string",
"analyzer": "simple"
},
...
The two queries given different performance (measured through apache bench):
- http://localhost:9200/videos/_search?q=account_id:1001560%20and%20text:vampire
- http://localhost:9200/videos/_search?q=account_id:1001560%20and%20text:vampire&routing=1001560
Make it such that if account_id field appears in query, it automatically assign it as routing (so that no need to update it at application level. )
Thank you.
request based on the discussion from the mailing list:
Hi Yuhan
Ah right. Not sure, but I think the answer is probably no. It won't do
that automatically. You'll still need to provide the routing value.
Maybe it could be supported. Perhaps open an issue.
clint
The text was updated successfully, but these errors were encountered: