-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Queryable object fields #25312
Copy link
Copy link
Closed
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>featureTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Metadata
Metadata
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>featureTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Type
Fields
Give feedbackNo fields configured for issues without a type.
Often we have large object fields with many sub-fields, only a few of which are needed for aggregations, sorting, or highlighting. Today, we create fields for all sub-fields, but we could greatly reduce the number of required fields if we make object fields queryable.
We would need a specialiased analyzer which can accept JSON and transform an object like:
into the following terms:
Then you could search for
activestatuses with:or
We could possibly even support searching for "New York" vs "New City of York" with:
which would be rewritten as
my_object:"city:new city:york"If we wanted to be able to aggregate on the
agefield, the object field could be mapped as:With this mapping, only the
my_object.agesub-field would have its own Lucene field (or Elasticsearch field) and the rest of the object would be queryable via themy_objectfield.This could even be made to work on the whole document by allowing the
_sourcefield to be configurable.