Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Derived Fields] Add parsing support for derived fields in mappings #12507

Closed
qreshi opened this issue Mar 1, 2024 · 0 comments
Closed

[Derived Fields] Add parsing support for derived fields in mappings #12507

qreshi opened this issue Mar 1, 2024 · 0 comments
Assignees
Labels
enhancement Enhancement or improvement to existing feature or request Search Search query, autocomplete ...etc

Comments

@qreshi
Copy link
Contributor

qreshi commented Mar 1, 2024

Is your feature request related to a problem? Please describe

Once the DerivedFieldMapper class is added, support for parsing it from mappings will need to be added.

Describe the solution you'd like

The definition for derived fields in the mappings will look something like the following:

"<name>": {
  "type": "keyword",
    "script": {
      "source": "<script>"
    }
}

Derived fields will be different from typical supported mapper fields in that the "type" can be any existing type (no current restrictions have been considered here yet but this issue will update if any have been identified during implementation). This would determine how the contents derived from the script are treated (ex. date, keyword, ip, etc.).

Typically from the MapperService perspective, the type is mapped to the underlying builder/parser of the Mapper classes so it's easy to identify how that field mapping would be parsed. Since type does not easily distinguish a derived field in this case though, we will add a separate named object that contains the derived fields for ease of separation in the mappings. For example:

{
  "some-index": {
    "mappings": {
      "derived": {
        "some_derived_field_name": {
          "type": "keyword",
          "script": {
            "source": "<script>"
          }
        }
      },
      "properties": {
        "some_other_field": {
          "type": keyword
        }
      }
    }
  }
}

Related component

Search

Describe alternatives you've considered

No response

Additional context

No response

@qreshi qreshi added enhancement Enhancement or improvement to existing feature or request untriaged labels Mar 1, 2024
@github-actions github-actions bot added the Search Search query, autocomplete ...etc label Mar 1, 2024
@qreshi qreshi mentioned this issue Mar 1, 2024
6 tasks
@rishabhmaurya rishabhmaurya moved this from Todo to In Progress in Performance Roadmap Mar 1, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Performance Roadmap Jun 10, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Search Project Board Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search Search query, autocomplete ...etc
Projects
Status: Done
Archived in project
Development

No branches or pull requests

2 participants