Skip to content

Conversation

@lockewritesdocs
Copy link
Contributor

@lockewritesdocs lockewritesdocs commented Feb 1, 2022

Adds a new section for accessing documents with the field API and explains the benefits of using this API over the old method of accessing document values.

Preview link: https://elasticsearch_83388.docs-preview.app.elstc.co/guide/en/elasticsearch/reference/master/script-fields-api.html

Relates to #61388

@lockewritesdocs lockewritesdocs added >docs General docs changes :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v8.1.0 labels Feb 1, 2022
@lockewritesdocs lockewritesdocs self-assigned this Feb 1, 2022
@elasticmachine elasticmachine added Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team labels Feb 1, 2022
@elasticmachine
Copy link
Collaborator

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

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

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.

This is a solid start! Left a few pieces of general feedback.

A couple other thoughts:

  • We should probably specify this is a feature preview and is subject to change somewhere.
  • Some fields do not yet work with the fields API such as text or geo since we are still trying to figure out the best values there to return, so continued use of doc there is what is available.
  • Need to differentiate between fields that return primitive types versus reference types since null can't be used for primitive defaults.

@stu-elastic
Copy link
Contributor

Let's avoid converting things to field yet, and instead move the text to a new section one level up called "field access in painless".

@mark-vieira mark-vieira removed the v8.1.0 label Feb 2, 2022
Copy link
Contributor

@stu-elastic stu-elastic left a comment

Choose a reason for hiding this comment

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

Very nice work

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.

This looks pretty good! Left a few comments to be addressed still.

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.

Table looks good to me! Thank you!

@lockewritesdocs lockewritesdocs merged commit d2e7b4c into elastic:master Feb 3, 2022
lockewritesdocs pushed a commit to lockewritesdocs/elasticsearch that referenced this pull request Feb 3, 2022
* [DOCS] Add documentation for Painless field API

* Moving content to a new page and incorporating reviewer feedback

* Clarify note

* Incorporating review comments

* Remove Object so as not to confuse it with the object type

* Add section and table for supported mapped field types

* Update table based on review feedback
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.1

@lockewritesdocs lockewritesdocs deleted the docs__painless-fields-api branch February 3, 2022 20:16
elasticsearchmachine pushed a commit that referenced this pull request Feb 3, 2022
* [DOCS] Add documentation for Painless field API

* Moving content to a new page and incorporating reviewer feedback

* Clarify note

* Incorporating review comments

* Remove Object so as not to confuse it with the object type

* Add section and table for supported mapped field types

* Update table based on review feedback
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 >docs General docs changes Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team v8.1.1 v8.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants