-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Feature Request: Remove restriction on copy_to to non-child fields #34428
Labels
>enhancement
:Search Foundations/Mapping
Index mappings, including merging and defining field types
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
Comments
Pinging @elastic/es-search-aggs |
Pinging @elastic/es-search (Team:Search) |
This has been open for quite a while, and hasn't had a lot of interest. For now I'm going to close this as something we aren't planning on implementing. We can re-open it later if needed. |
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 Foundations
Meta label for the Search Foundations team in Elasticsearch
I have data the is coming in like this, which I am unable to change:
{"tags":["foo=bar", "foo=quux", "blah=blarg"]}
You can see that there are keys (
foo
andblah
) and values (bar
,quux
, andblarg
).I would like to be able to run aggregation queries against this in order to give me all the keys, with a sub-aggregation for all their values. (ie: how many times does "foo" key occur, and how many times does each of its bar and quux values occur?)
I could normally do this with a nested type, so I tried to make one:
The
key_normalizer
just takes the string "foo=bar" and turns it into "foo". Thevalue_normalizer
turns it into "bar".Turns out this is not allowed:
Illegal combination of [copy_to] and [nested] mappings: [copy_to] may only copy data to the current nested document or any of its parents, however one [copy_to] directive is trying to copy data from nested object [null] to [ntags]
So I also tried adding
ntags
as a multi-field underneathtags
, but go this error, not that it would have helped since the copy_to probably doesn't work on sub-multi-fields anyway:Type [nested] cannot be used in multi field
I can't change the format my data comes in as.
So... Is there something else I can do, either at index time or query time?
And if not, can the restriction on copy_to be removed?
(Some additional context here: https://discuss.elastic.co/t/how-to-sub-aggregate-an-array-that-contains-another-field/152155 )
The text was updated successfully, but these errors were encountered: