Skip to content

Conversation

@stu-elastic
Copy link
Contributor

@stu-elastic stu-elastic commented Jan 13, 2022

The flattened field type exposes all leaf values
as keyword doc values. Additionally, specific keys
are available via object dot notation.

For example:

{
  "flat": {
    "abc": "bar",
    "def": "foo",
    "hij": {
      "lmn": "pqr",
      "stu": 123
    }
  }
}

field('flat').get('default') // returns 123
field('flat.abc').get('default') // returns bar

API:

  • iterator()
  • get(String default)
  • get(String default, int index)

Refs: #79105

The flattened field type exposes all leaf values
as keyword doc values.  Additionally, specific keys
are available via object dot notation.

For example:

```
{
  "flat": {
    "abc": "bar",
    "def": "foo",
    "hij": {
      "lmn": "pqr",
      "stu": 123
    }
  }
}

field('flat').get('default') // returns 123
field('flat.abc').get('default') // returns bar
```

API:
* `iterator()`
* `get(String default)`
* `get(String default, int index)`

Refs: elastic#79105
@stu-elastic stu-elastic added >enhancement :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v8.1.0 labels Jan 13, 2022
@stu-elastic stu-elastic requested a review from jdconrad January 13, 2022 22:35
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Jan 13, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine
Copy link
Collaborator

Hi @stu-elastic, I've created a changelog YAML for you.

@stu-elastic
Copy link
Contributor Author

@elasticmachine update branch

Copy link
Contributor

@jdconrad jdconrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@stu-elastic stu-elastic merged commit 58ce0f9 into elastic:master Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement Team:Core/Infra Meta label for core/infra team v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants