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

Follow-up improvements to field retrieval. #60985

Closed
8 tasks done
jtibshirani opened this issue Aug 11, 2020 · 3 comments
Closed
8 tasks done

Follow-up improvements to field retrieval. #60985

jtibshirani opened this issue Aug 11, 2020 · 3 comments
Labels
>enhancement experimental/beta Meta :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@jtibshirani
Copy link
Contributor

jtibshirani commented Aug 11, 2020

In #55363 we designed a first version of a fields option for retrieving document fields during a search. This issue tracks important follow-up changes to 'complete' the feature.

Changes that could affect the API (should be resolved before removing 'beta' flag):

Other changes:

@jtibshirani jtibshirani added >enhancement :Search/Search Search-related issues that do not fall into other categories Meta labels Aug 11, 2020
@elasticmachine
Copy link
Collaborator

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

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Aug 11, 2020
jtibshirani added a commit that referenced this issue Oct 17, 2020
We've identified two important enhancements that may affect the API. We expect
any API changes from these enhancements to be minor, but want to leave open the
possibility for small breaks. For example, we may end up returning unmapped
fields by default, or omitting nested fields from the root hit. The impact to
users should be quite small.

We're tracking the issues we need to resolve before removing the 'beta' label
here: #60985.
jtibshirani added a commit that referenced this issue Oct 18, 2020
We've identified two important enhancements that may affect the API. We expect
any API changes from these enhancements to be minor, but want to leave open the
possibility for small breaks. For example, we may end up returning unmapped
fields by default, or omitting nested fields from the root hit. The impact to
users should be quite small.

We're tracking the issues we need to resolve before removing the 'beta' label
here: #60985.
jtibshirani added a commit that referenced this issue Oct 18, 2020
We've identified two important enhancements that may affect the API. We expect
any API changes from these enhancements to be minor, but want to leave open the
possibility for small breaks. For example, we may end up returning unmapped
fields by default, or omitting nested fields from the root hit. The impact to
users should be quite small.

We're tracking the issues we need to resolve before removing the 'beta' label
here: #60985.
@jtibshirani
Copy link
Contributor Author

jtibshirani commented Mar 31, 2021

We discussed how flattened fields should be returned, and agreed on this proposal:

  • Right now, if the parent flattened field is requested, we return its value as a JSON object. We do not flatten the value and return all the subfields as individual keys in the response. We'd like to stick with the current behavior, since it's simple and consistent with how we handle all other fields: if you request a field like my_field, then the response will contain the field's value under that same key my_field. Adding a new key for every subfield could actually be surprising behavior for users. Returning all the individual keys might also defeat the purpose of flattened fields -- they are useful when you have a large number of distinct subfields, and client code doesn't actually want to handle each subfield as its own 'column' by default.
  • We don't currently support retrieving flattened subfields directly, as in "fields": [ "flattened_field.subfield"]. We would like to support this, and are tracking the enhancement in Support fetching flattened subfields #70605.

To clarify, this means that when requesting "fields": ["*"], the response contains an entry for the parent flattened field, but no entries for the subfields:

{
  "fields": [{ 
    "flattened_field": [{
      "subfield1": "value1",
      "subfield2": "value2"
    },
    "other_numeric_field": [ 42 ]
  }]
}

@jtibshirani
Copy link
Contributor Author

jtibshirani commented Mar 31, 2021

Since we've addressed all issues and open questions, we can close this out and mark fields as 'GA'. I opened #71130 to remove the 'beta' flag.

jtibshirani added a commit that referenced this issue Mar 31, 2021
Now that we've addressed the open issues, the 'fields' option can be considered GA.

Relates to #60985.
jtibshirani added a commit that referenced this issue Mar 31, 2021
Now that we've addressed the open issues, the 'fields' option can be considered GA.

Relates to #60985.
jtibshirani added a commit that referenced this issue Mar 31, 2021
Now that we've addressed the open issues, the 'fields' option can be considered GA.

Relates to #60985.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement experimental/beta Meta :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

2 participants