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

Add docs for the fields retrieval API. #58787

Merged
merged 2 commits into from
Jul 8, 2020

Conversation

jtibshirani
Copy link
Contributor

@jtibshirani jtibshirani commented Jun 30, 2020

This PR adds docs for the fields parameter. We now present fields as the
preferred way to load specific fields in a search, with docvalue_fields and
stored_fields as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.

Relates to #55363.

@jtibshirani jtibshirani added >docs General docs changes :Search/Search Search-related issues that do not fall into other categories labels Jun 30, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (>docs)

@elasticmachine elasticmachine added the Team:Docs Meta label for docs team label Jun 30, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jun 30, 2020
@jtibshirani
Copy link
Contributor Author

jtibshirani commented Jun 30, 2020

There are so many options to load fields now, it will be important to simplify this in a follow-up effort. Some ideas (not for this PR, just giving context):

  • Remove the need for the stored_fields parameter.
  • Based on user feedback on fields, maybe we'll no longer need source filtering.

@jtibshirani jtibshirani requested a review from nik9000 June 30, 2020 21:27
@jtibshirani jtibshirani force-pushed the fields-param-docs branch 2 times, most recently from c18087b to fa97ad0 Compare June 30, 2020 22:24
The `fields` parameter consults both a document's `_source` and the index
mappings to load and return values. Because it makes use of the mappings,
`fields` has some advantages over referencing the `_source` directly: it
accepts <<multi-fields, multi-fields>> and <<alias, field aliases>>, and
Copy link
Member

Choose a reason for hiding this comment

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

I think if we're going to tell people to use this API we should compare everything to it. In other words, I think this information belongs in a section on _source.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you explain a bit more what you mean here?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I can express it super well. How would you feel about merging as is and I can open a follow up at some point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That works for me -- we could also chat offline if it's helpful. I do think that if we advocate always using the fields API, we should stop presenting it as an alternative to _source (and maybe stop returning the _source by default)? We can think about this when considering follow-ups.

docs/reference/search/search-fields.asciidoc Show resolved Hide resolved
docs/reference/search/search-fields.asciidoc Outdated Show resolved Hide resolved
@jtibshirani jtibshirani requested a review from nik9000 July 8, 2020 01:20
Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

LGTM

@jtibshirani jtibshirani merged this pull request into elastic:field-retrieval Jul 8, 2020
@jtibshirani jtibshirani deleted the fields-param-docs branch July 8, 2020 19:34
jtibshirani added a commit that referenced this pull request Jul 8, 2020
This PR adds docs for the `fields` parameter. We now present `fields` as the
preferred way to load specific fields in a search, with `docvalue_fields` and
`stored_fields` as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.
jtibshirani added a commit that referenced this pull request Jul 14, 2020
This PR adds docs for the `fields` parameter. We now present `fields` as the
preferred way to load specific fields in a search, with `docvalue_fields` and
`stored_fields` as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.
jtibshirani added a commit that referenced this pull request Jul 15, 2020
This PR adds docs for the `fields` parameter. We now present `fields` as the
preferred way to load specific fields in a search, with `docvalue_fields` and
`stored_fields` as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.
jtibshirani added a commit that referenced this pull request Jul 16, 2020
This PR adds docs for the `fields` parameter. We now present `fields` as the
preferred way to load specific fields in a search, with `docvalue_fields` and
`stored_fields` as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.
jtibshirani added a commit that referenced this pull request Jul 18, 2020
This PR adds docs for the `fields` parameter. We now present `fields` as the
preferred way to load specific fields in a search, with `docvalue_fields` and
`stored_fields` as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.
jtibshirani added a commit that referenced this pull request Jul 21, 2020
This PR adds docs for the `fields` parameter. We now present `fields` as the
preferred way to load specific fields in a search, with `docvalue_fields` and
`stored_fields` as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.
jtibshirani added a commit that referenced this pull request Jul 23, 2020
This PR adds docs for the `fields` parameter. We now present `fields` as the
preferred way to load specific fields in a search, with `docvalue_fields` and
`stored_fields` as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.
jtibshirani added a commit to jtibshirani/elasticsearch that referenced this pull request Jul 27, 2020
This PR adds docs for the `fields` parameter. We now present `fields` as the
preferred way to load specific fields in a search, with `docvalue_fields` and
`stored_fields` as other options to look into. Source filtering is no longer
featured prominently, and its section is moved to the end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search/Search Search-related issues that do not fall into other categories Team:Docs Meta label for docs team Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants