Is your feature request related to a problem? Please describe.
Yes. We’re trying to support cross cluster search in the OpenSearch sql plugin. As part of our sql and ppl query execution flow, some metadata is required for query analysis and plan generation. We need field mappings for each index at remote clusters.
Related issue: opensearch-project/sql#789
Here are some example responses of REST api for mappings request. Though we will not be using the REST api directly for our use case, this shows the problem more clearly:
- GET /remote-cluster:index/_mappings
{
"error": {
"root_cause": [
{
"type": "index_not_found_exception",
"reason": "no such index [ccs-cluster:index]",
"index": "ccs-cluster:index",
"resource.id": "ccs-cluster:index",
"resource.type": "index_or_alias",
"index_uuid": "_na_"
}
],
"type": "index_not_found_exception",
"reason": "no such index [ccs-cluster:index]",
"index": "ccs-cluster:index",
"resource.id": "ccs-cluster:index",
"resource.type": "index_or_alias",
"index_uuid": "_na_"
},
"status": 404
}
A side note on the second request: it returns nothing, which we consider a bug.
Describe the solution you'd like
We need some transport layer actions to support querying field mappings on cross clusters. We have no clear solution on how to achieve that. The requirement is that we can, for example, provide indices name with cross cluster syntax (*:index, ccs-cluster:index) for get mappings requests. For example, in this function.
Describe alternatives you've considered
We could get such info by making individual connections to each of the remote clusters, but that defeats the purpose of using cross cluster search in the first place. Following this path, we’ll also have to reinvent the wheel of cluster name resolving and request re-routing.
Additional context
Some context on how we’re querying field mappings currently:
Is your feature request related to a problem? Please describe.
Yes. We’re trying to support cross cluster search in the OpenSearch sql plugin. As part of our sql and ppl query execution flow, some metadata is required for query analysis and plan generation. We need field mappings for each index at remote clusters.
Related issue: opensearch-project/sql#789
Here are some example responses of REST api for mappings request. Though we will not be using the REST api directly for our use case, this shows the problem more clearly:
A side note on the second request: it returns nothing, which we consider a bug.
Describe the solution you'd like
We need some transport layer actions to support querying field mappings on cross clusters. We have no clear solution on how to achieve that. The requirement is that we can, for example, provide indices name with cross cluster syntax (
*:index,ccs-cluster:index) for get mappings requests. For example, in this function.Describe alternatives you've considered
We could get such info by making individual connections to each of the remote clusters, but that defeats the purpose of using cross cluster search in the first place. Following this path, we’ll also have to reinvent the wheel of cluster name resolving and request re-routing.
Additional context
Some context on how we’re querying field mappings currently: