# SynonymTokenFilterFactory class passes indexSettings to TokenizerFactory

**URL:** <https://discuss.elastic.co/t/synonymtokenfilterfactory-class-passes-indexsettings-to-tokenizerfactory/22996>\
**Category:** Elasticsearch\
**Created:** [March 31, 2015, 5:55am UTC](https://discuss.elastic.co/t/synonymtokenfilterfactory-class-passes-indexsettings-to-tokenizerfactory/22996 "2015-03-31T05:55:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yfujita](https://avatars.discourse-cdn.com/v4/letter/y/9fc29f/32.png) [@yfujita](https://discuss.elastic.co/u/yfujita)\
**Post date:** [March 31, 2015, 5:55am UTC](https://discuss.elastic.co/t/synonymtokenfilterfactory-class-passes-indexsettings-to-tokenizerfactory/22996/1 "2015-03-31T05:55:58Z")

</div>

Hi.  
I have a question about behavior of SynonymTokenFilterFactory class.

I expect that "settings" parameter of TokenizerFactory is tokenizer's  
settings. However, SynonymTokenFilterFactory passes indexSettings to  
"settings" parameter of TokenizerFactory.

```
final TokenizerFactory tokenizerFactory = 

```

tokenizerFactoryFactory.create(tokenizerName, indexSettings);

SynonymTokenFilterFactory was changed by the following commit.

> <https://github.com/elastic/elasticsearch/commit/ac4b39bd8f54c38f55a0b02f432c4ee5f47caf03#diff-594b28da352e9e981182b5466c294388>

Is the behavior changed?

At Elasticsearch 1.3, the following setting works. "bigramTokenizer" of  
synonymTest gets (min\_gram/max\_gram) settings.

curl -XPUT localhost:9200/test -d '{  
"settings" : {  
"analysis" : {  
"analyzer" : {  
"bigram\_analyzer" : {  
"type" : "custom",  
"tokenizer" : "bigramTokenizer",  
"filter" : ["synonymTest"]  
}  
},  
"tokenizer" : {  
"bigramTokenizer" : {  
"type" : "ngram",  
"min\_gram" : 2,  
"max\_gram" : 2  
}  
},  
"filter" : {  
"synonymTest" : {  
"type" : "synonym",  
"synonyms\_path" : "synonym.txt",  
"tokenizer" : "bigramTokenizer",  
"min\_gram" : 2,  
"max\_gram" : 2  
}  
}  
}  
}  
}'

At Elasticsearch 1.5, it does not work.

Thanks in advance,  
Yosuke

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/dbcceb52-7b7a-45a3-ae48-2a844f414263%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dbcceb52-7b7a-45a3-ae48-2a844f414263%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [April 8, 2015, 3:21pm UTC](https://discuss.elastic.co/t/synonymtokenfilterfactory-class-passes-indexsettings-to-tokenizerfactory/22996/2 "2015-04-08T15:21:05Z")

</div>

Hi Yosuke,

Thanks for reporting.  
I think that is bug, it should work 1.5.  
I will open Issue and create PR, soon.

2015-03-31 14:55 GMT+09:00 [yfujita@n2sm.net](mailto:yfujita@n2sm.net):

> Hi.  
> I have a question about behavior of SynonymTokenFilterFactory class.
> 
> I expect that "settings" parameter of TokenizerFactory is tokenizer's  
> settings. However, SynonymTokenFilterFactory passes indexSettings to  
> "settings" parameter of TokenizerFactory.
> 
> ```
> final TokenizerFactory tokenizerFactory =
> 
> ```
> 
> tokenizerFactoryFactory.create(tokenizerName, indexSettings);
> 
> SynonymTokenFilterFactory was changed by the following commit.
> 
> [[CORE] Be more explicit if index.version.created is not set · elastic/elasticsearch@ac4b39b · GitHub](https://github.com/elastic/elasticsearch/commit/ac4b39bd8f54c38f55a0b02f432c4ee5f47caf03#diff-594b28da352e9e981182b5466c294388)
> 
> Is the behavior changed?
> 
> At Elasticsearch 1.3, the following setting works. "bigramTokenizer" of  
> synonymTest gets (min\_gram/max\_gram) settings.
> 
> curl -XPUT localhost:9200/test -d '{  
> "settings" : {  
> "analysis" : {  
> "analyzer" : {  
> "bigram\_analyzer" : {  
> "type" : "custom",  
> "tokenizer" : "bigramTokenizer",  
> "filter" : ["synonymTest"]  
> }  
> },  
> "tokenizer" : {  
> "bigramTokenizer" : {  
> "type" : "ngram",  
> "min\_gram" : 2,  
> "max\_gram" : 2  
> }  
> },  
> "filter" : {  
> "synonymTest" : {  
> "type" : "synonym",  
> "synonyms\_path" : "synonym.txt",  
> "tokenizer" : "bigramTokenizer",  
> "min\_gram" : 2,  
> "max\_gram" : 2  
> }  
> }  
> }  
> }  
> }'
> 
> At Elasticsearch 1.5, it does not work.
> 
> Thanks in advance,  
> Yosuke
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/dbcceb52-7b7a-45a3-ae48-2a844f414263%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dbcceb52-7b7a-45a3-ae48-2a844f414263%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/dbcceb52-7b7a-45a3-ae48-2a844f414263%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/dbcceb52-7b7a-45a3-ae48-2a844f414263%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## --

Jun Ohtani  
blog : [http://blog.johtani.info](http://blog.johtani.info)

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPW8A5wXsN8jUB0zSBJwGyKPfFSPS9JD2GoKAqu5OJU0y4eEyw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPW8A5wXsN8jUB0zSBJwGyKPfFSPS9JD2GoKAqu5OJU0y4eEyw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 2017, 12:20am UTC](https://discuss.elastic.co/t/synonymtokenfilterfactory-class-passes-indexsettings-to-tokenizerfactory/22996/3 "2017-07-06T00:20:50Z")

</div>


