I'd like to inspect the _mapping of given a specific field/value in an ES
index of a specific type. The way we set up our data (due to design of
nesting/parent-child relationships) was to put them all under one type,
then have a subType field. Unfortunately, as data is indexed and the
_mapping schema dynamically builds out, the _mapping shows all the possible
fields of that type, and I can't query or filter the _mapping. This makes
sense (_mapping is more of a config schema file per se, not a search API as
I understand it), but is there any workaround that could give us the
desired result? Here is an example:
So localhost:9200/Farm/Animal/_mapping retrieves the mapping. But in our
data we have a field animalType. I want to get the 'populated' fields, i.e.
the dynamically built mappings file, but only when animalType is Cow, for
A clear workaround is to redesign our data and index to look like
/Farm/Cow, /Farm/Sheep, in which case /Farm/Cow/_mapping would return the
desired fields for the Cow type. But that disrupts other aspects of our
data design due for maintaining parent-children.
Is it possible to query/generate a field list when we have Farm/Animal and
animalType is Cow, without scanning all data? Sort of like a facets query,
where the facet is on the field names (instead of a specific field), the
counts being how often they are used! It would be like faceting on the
schema, if it were searchable. Sorry if that's confusing!
Thanks for any ideas!
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.