Using Terms aggregation on custom type


(Geert Vos) #1

Hi,

We are working on search engine that is optimized for searching in time.
The bases is an elasticsearch cluster with a plugin that registers our own
type. The type we created is registered using our own type name:
"timedterms".

Now we try to use the built in aggregations on our own type, and
ElasticSearch throws an exception because it cannot find any field data
builder:

Caused by: org.elasticsearch.ElasticsearchIllegalArgumentException: failed
to find field data builder for field annotations.md::ttxsubtitle, and type
timedterms
at org.elasticsearch.index.fielddata.IndexFieldDataService.getForField(
IndexFieldDataService.java:221)
at org.elasticsearch.search.aggregations.bucket.terms.TermsParser.parse(
TermsParser.java:229)
at org.elasticsearch.search.aggregations.AggregatorParsers.
parseAggregators(AggregatorParsers.java:114)
at org.elasticsearch.search.aggregations.AggregatorParsers.
parseAggregators(AggregatorParsers.java:77)
at org.elasticsearch.search.aggregations.AggregationParseElement.parse(
AggregationParseElement.java:60)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java
:622)

It seems that the index field data service needs to have our type
registered. But, it looks like all types are hardcoded in the service and
there is no extension point. The IndexFieldDataService checks the following
maps, which are all immutable: "buildersByType", "docValuesBuildersByType",
"buildersByTypeAndFormat".

How can we reuse the terms aggregation for our own type? Or do we need to
write our own aggregation?

With kinds regards,
Geert Vos

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/703d8eed-7129-488e-94fa-df8f1e75b3d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2