OpenSearch icon indicating copy to clipboard operation
OpenSearch copied to clipboard

[Feature Request] Rename fields as part of index alias

Open ev2900 opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe

I have multiple people searching the same OpenSearch index and different people want fields in the index to be named differently.

I want the ability to rename fields as part of an index alias.

Describe the solution you'd like

When I create an index alias I want the ability to rename a field.

Related component

Indexing

Describe alternatives you've considered

I have looked into using script_fields to rename fields during a search execution and using alias field type. Unfortunately neither of these solutions work for my use case.

Additional context

No response

ev2900 avatar Feb 08 '24 15:02 ev2900

@ev2900 Have you looked into search pipelines? The rename field response processor may offer a solution to your problem.

andrross avatar Feb 08 '24 19:02 andrross

@ev2900 there is a feature in OpenSearch to provide alias (another name) to existing field - https://opensearch.org/docs/2.11/field-types/supported-field-types/alias/ This should provide the rename support you are looking for.

PUT movies 
{
  "mappings" : {
    "properties" : {
      "year" : {
        "type" : "date"
      },
      "release_date" : {
        "type" : "alias",
        "path" : "year"
      }
    }
  }
}

shwetathareja avatar Feb 09 '24 10:02 shwetathareja