# Use lucene FacetField instead of Elasticsearch MutiBucketCollector to improve performance

**URL:** <https://discuss.elastic.co/t/use-lucene-facetfield-instead-of-elasticsearch-mutibucketcollector-to-improve-performance/197044>\
**Category:** Elasticsearch\
**Created:** [August 28, 2019, 7:03am UTC](https://discuss.elastic.co/t/use-lucene-facetfield-instead-of-elasticsearch-mutibucketcollector-to-improve-performance/197044 "2019-08-28T07:03:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![YinRong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yinrong/32/53145_2.png) [@YinRong](https://discuss.elastic.co/u/YinRong)\
**Post date:** [August 28, 2019, 7:03am UTC](https://discuss.elastic.co/t/use-lucene-facetfield-instead-of-elasticsearch-mutibucketcollector-to-improve-performance/197044/1 "2019-08-28T07:03:03Z")

</div>

I'm doing aggs.terms (StringTermsAggregator) on 300 fields, which takes 60~100ms (there are 300 docs after query/filter).

If using lucene org.apache.lucene.facet.FacetsCollector, it takes 10ms.

Is there a way to use lucene FacetField in Elasticseach? If not, should we add such a field type?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 25, 2019, 7:03am UTC](https://discuss.elastic.co/t/use-lucene-facetfield-instead-of-elasticsearch-mutibucketcollector-to-improve-performance/197044/2 "2019-09-25T07:03:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
