# Synonym token filter feature is time-consuming when synonym dict is big

**URL:** <https://discuss.elastic.co/t/synonym-token-filter-feature-is-time-consuming-when-synonym-dict-is-big/135075>\
**Category:** Elasticsearch\
**Created:** [June 8, 2018, 3:40am UTC](https://discuss.elastic.co/t/synonym-token-filter-feature-is-time-consuming-when-synonym-dict-is-big/135075 "2018-06-08T03:40:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aimerlee860](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@aimerlee860](https://discuss.elastic.co/u/aimerlee860)\
**Post date:** [June 8, 2018, 3:40am UTC](https://discuss.elastic.co/t/synonym-token-filter-feature-is-time-consuming-when-synonym-dict-is-big/135075/1 "2018-06-08T03:40:09Z")

</div>

Elasticsearch Version: 5.4.2

I try to create a index, some of fields use a self-developed analyzer, and the analyzer use a big list for tokenizer and synonym. I find that it will take a long time like an hour to finish the creation.  
I also try to use the 'synonym token filter' feature ( [https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-tokenfilter.html) ), when the settings.index.analysis.analyzer.synonym.filter has hundreds of elements， it will also take minutes to create.  
I check the source code and find that the settings will be validated firstly, whick will take a long time to process. Here are some source files related:  
core/src/main/java/org/elasticsearch/cluster/metadata/MetaDataUpdateSettingsService.java#updateSettings  
core/src/main/java/org/elasticsearch/common/settings/AbstractScopedSettings.java#validate  
core/src/main/java/org/elasticsearch/common/settings/Setting.java#groupSetting#get  
core/src/main/java/org/elasticsearch/common/settings/Settings.java#getByPrefix  
Is this a problem of elasticsearch? or do I use this feature improperly? How can I use this feature?

---

<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:** [July 6, 2018, 3:40am UTC](https://discuss.elastic.co/t/synonym-token-filter-feature-is-time-consuming-when-synonym-dict-is-big/135075/2 "2018-07-06T03:40:14Z")

</div>

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