Skip to content

Conversation

@cbuescher
Copy link
Member

Currently the fields API fetches the root flattened field and returns it in a
structured way in the response. In addition this change makes it possible to
directly query subfields. However, requesting flattened subfields via wildcard
patterns is not possible.

Closes #70605

Currently the `fields` API fetches the root flattened field and returns it in a
structured way in the response. In addition this change makes it possible to
directly query subfields. However, requesting flattened subfields via wildcard
patterns is not possible.

Closes elastic#70605
@cbuescher cbuescher added >enhancement :Search Foundations/Mapping Index mappings, including merging and defining field types v8.0.0 v7.13.0 labels Mar 26, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Mar 26, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

I think this is generally the right way to go - left a couple of comments.

Copy link
Contributor

@jtibshirani jtibshirani 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 good to me, just left some small suggestions.

@cbuescher
Copy link
Member Author

@jtibshirani thanks, I think I adressed your change requests and added a unit and a yaml test. I think I will also add a short passage to the docs somewhere about fetching flattened subfields and that the naming has to be exact, I haven't found a good spot yet though. Will be back with another short update shortly.

Copy link
Contributor

@jtibshirani jtibshirani 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 good to me! I added some last minor comments.


[discrete]
[[search-fields-flattened]]
==== Handling of flattened fields
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to move this to the flattened field type documentation. That would help keep this high-level documentation streamlined and easy to approach.

}

@Override
public ValueFetcher valueFetcher(SearchExecutionContext context, String format) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized we should throw an error if the format is non-null, as we do for most other field types. (This is unfortunately very manual right now and easy to forget...)

Christoph Büscher added 2 commits April 14, 2021 21:34
Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the iterations @cbuescher

@cbuescher cbuescher merged commit 948d02e into elastic:master Apr 15, 2021
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Apr 15, 2021
Currently the `fields` API fetches the root flattened field and returns it in a
structured way in the response. In addition this change makes it possible to
directly query subfields. However, requesting flattened subfields via wildcard
patterns is not possible.

Closes elastic#70605
cbuescher pushed a commit that referenced this pull request Apr 15, 2021
Currently the `fields` API fetches the root flattened field and returns it in a
structured way in the response. In addition this change makes it possible to
directly query subfields. However, requesting flattened subfields via wildcard
patterns is not possible.

Closes #70605
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.13.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support fetching flattened subfields

5 participants