# How to add per-field and customized analyzer to elastic search

**URL:** <https://discuss.elastic.co/t/how-to-add-per-field-and-customized-analyzer-to-elastic-search/4410>\
**Category:** Elasticsearch\
**Created:** [May 16, 2011, 10:04am UTC](https://discuss.elastic.co/t/how-to-add-per-field-and-customized-analyzer-to-elastic-search/4410 "2011-05-16T10:04:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [May 16, 2011, 10:04am UTC](https://discuss.elastic.co/t/how-to-add-per-field-and-customized-analyzer-to-elastic-search/4410/1 "2011-05-16T10:04:55Z")

</div>

Hi, all  
I need to used different analyzer for each field of my document and  
also the analyzer can not be composed using the provided tokenizer,  
filters by elasticsearch.

Can i put my \*.class some where and configure elasticsearch to use it?

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [May 16, 2011, 11:21am UTC](https://discuss.elastic.co/t/how-to-add-per-field-and-customized-analyzer-to-elastic-search/4410/2 "2011-05-16T11:21:53Z")

</div>

You can specify a custom filter in elasticsearch.json with that it is  
easy to specify the whole analyzer:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

{  
"index" : {  
"analysis" : {  
"analyzer" : {  
"index\_analyzer" : {  
"tokenizer" : "whitespace",  
"filter" : ["jetwickfilter", "lowercase",  
"snowball"]  
},  
"search\_analyzer" :  
{  
"tokenizer" : "whitespace",  
"filter" : ["jetwickfilter", "lowercase",  
"snowball"]  
}  
},  
"filter" : {  
"jetwickfilter": {  
"type" : "de.jetwick.es.JetwickFilterFactory"  
},  
"snowball": {  
"type" : "snowball",  
"language" : "English"  
}  
}  
}  
}  
}

On May 16, 12:04 pm, Weiwei Wang [ww.wang...@gmail.com](mailto:ww.wang...@gmail.com) wrote:

> Hi, all  
> I need to used different analyzer for each field of my document and  
> also the analyzer can not be composed using the provided tokenizer,  
> filters by elasticsearch.
> 
> Can i put my \*.class some where and configure elasticsearch to use it?

---

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [May 17, 2011, 2:27am UTC](https://discuss.elastic.co/t/how-to-add-per-field-and-customized-analyzer-to-elastic-search/4410/3 "2011-05-17T02:27:56Z")

</div>

thanks,tableyourtime.

What i need is a per-field analyzer, how can i custom it and where  
should i put my own \*.class files?

On May 16, 7:21 pm, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:

> You can specify a custom filter in elasticsearch.json with that it is  
> easy to specify the whole analyzer:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/c)...
> 
> {  
> "index" : {  
> "analysis" : {  
> "analyzer" : {  
> "index\_analyzer" : {  
> "tokenizer" : "whitespace",  
> "filter" : ["jetwickfilter", "lowercase",  
> "snowball"]  
> },  
> "search\_analyzer" :  
> {  
> "tokenizer" : "whitespace",  
> "filter" : ["jetwickfilter", "lowercase",  
> "snowball"]  
> }  
> },  
> "filter" : {  
> "jetwickfilter": {  
> "type" : "de.jetwick.es.JetwickFilterFactory"  
> },  
> "snowball": {  
> "type" : "snowball",  
> "language" : "English"  
> }  
> }  
> }  
> }
> 
> }
> 
> On May 16, 12:04 pm, Weiwei Wang [ww.wang...@gmail.com](mailto:ww.wang...@gmail.com) wrote:
> 
> > Hi, all  
> > I need to used different analyzer for each field of my document and  
> > also the analyzer can not be composed using the provided tokenizer,  
> > filters by elasticsearch.
> 
> > Can i put my \*.class some where and configure elasticsearch to use it?

---

<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, 4:06am UTC](https://discuss.elastic.co/t/how-to-add-per-field-and-customized-analyzer-to-elastic-search/4410/4 "2017-07-06T04:06:01Z")

</div>


