# Max\_expansions performance concerns

**URL:** <https://discuss.elastic.co/t/max-expansions-performance-concerns/209045>\
**Category:** Elasticsearch\
**Created:** [November 22, 2019, 10:39am UTC](https://discuss.elastic.co/t/max-expansions-performance-concerns/209045 "2019-11-22T10:39:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sachmuchsachin](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@sachmuchsachin](https://discuss.elastic.co/u/sachmuchsachin)\
**Post date:** [November 22, 2019, 10:39am UTC](https://discuss.elastic.co/t/max-expansions-performance-concerns/209045/1 "2019-11-22T10:39:11Z")

</div>

Is there a serious concern if I set max\_expansions to a very large value say 5000?

I have ~100 millions documents and I search on phone number prefixes (stored as sequence of digits). As data has grown, search accuracy has gone down and now sometimes I have to enter 6 or 7 digits to get matches for search.

I would like to quick fix by increasing the property max\_expansions to 5000 in my query for search, taking a performance hit. Before I go with n-gram tokenizer.

Are there any serious concerns with such a large value of max\_expansions (from 50 to 5k)?

---

<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:** [December 20, 2019, 10:39am UTC](https://discuss.elastic.co/t/max-expansions-performance-concerns/209045/2 "2019-12-20T10:39:22Z")

</div>

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