Skip to content

[FEATURE] Migrate index schema fetch api from _mappings to _field_caps #4551

Closed

Description

@penghuo

Is your feature request related to a problem?
Since OpenSearch does not support cross cluster index metadata retrieval, field mapping of a remote cluster index is not available to the local cluster. (opensearch-project/OpenSearch#6573) Therefore, the query engine requires that for any remote cluster index that the users need to search, the local cluster keep a field mapping system index with the same index name. This can be done by creating an index on the local cluster with the same name and schema as the remote cluster index.

https://github.com/opensearch-project/sql/blob/main/docs/user/ppl/admin/cross_cluster_search.rst#limitations

What solution would you like?
User can query index in remote cluster without setup index in local cluster.

###
POST {{local}}/_plugins/_ppl
Content-Type: application/x-ndjson

{
    "query": "source=`remoteCluster:products` | stats count() by id"
}
  • _mappings API does not support refering to remote cluster index
###
GET {{local}}/remoteCluster:products/_mappings

### Response
{
  "error": {
    "root_cause": [
      {
        "type": "index_not_found_exception",
        "reason": "no such index [b:products]",
        "index": "b:products",
        "resource.id": "b:products",
        "resource.type": "index_or_alias",
        "index_uuid": "_na_"
      }
    ],
    "type": "index_not_found_exception",
    "reason": "no such index [b:products]",
    "index": "b:products",
    "resource.id": "b:products",
    "resource.type": "index_or_alias",
    "index_uuid": "_na_"
  },
  "status": 404
}
  • _field_caps can support refer remote cluster index in local cluster
###
GET {{local}}/remoteCluster:products/_field_caps?fields=*

### Response
{
  "indices": [
    "b:products"
  ],
  "fields": {
    "price": {
      "double": {
        "type": "double",
        "searchable": true,
        "aggregatable": true
      }
    },
    "name": {
      "keyword": {
        "type": "keyword",
        "searchable": true,
        "aggregatable": true
      }
    },
    "id": {
      "keyword": {
        "type": "keyword",
        "searchable": true,
        "aggregatable": true
      }
    },
    "category": {
      "keyword": {
        "type": "keyword",
        "searchable": true,
        "aggregatable": true
      }
    },

  }
}

What alternatives have you considered?
n/a

Do you have any additional context?
Follow READE.me to setup cross cluster, use ccs.http to test PPL cross cluster.
https://github.com/penghuo/BusyBox/tree/main/ppl/ccs

Activity

  1. added
    enhancement
    on Oct 14, 2025
  2. added
    PPL
    and removed on Oct 14, 2025
  3. ishag4 commented on Apr 16, 2026

    @ishag4
    Contributor

    Hi @penghuo , I’m interested in contributing to this feature. You can assign it to me.
    Thanks!

  4. ishag4 commented on Apr 23, 2026

    @ishag4
    Contributor

    Hi @penghuo @RyanL1997, just checking in, should I go ahead and start working on this?
    Thanks!

  5. moved this from Not Started to Done in PPL Trackeron Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions