# Adding filter to existing analyzer

**URL:** <https://discuss.elastic.co/t/adding-filter-to-existing-analyzer/7593>\
**Category:** Elasticsearch\
**Created:** [May 8, 2012, 9:34am UTC](https://discuss.elastic.co/t/adding-filter-to-existing-analyzer/7593 "2012-05-08T09:34:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![barnybug](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@barnybug](https://discuss.elastic.co/u/barnybug)\
**Post date:** [May 8, 2012, 9:34am UTC](https://discuss.elastic.co/t/adding-filter-to-existing-analyzer/7593/1 "2012-05-08T09:34:12Z")

</div>

Would like to add asciifolding to the default english analyzer. Is this  
possible?  
Or alternatively can I define a new analyzer with the same  
tokenizer/filters as the EnglishAnalyzer?

thanks

Barnaby

---

<div class="post-metadata">

**Author:** ![Jan\_Fiedler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jan_fiedler/32/2518_2.png) [@Jan\_Fiedler](https://discuss.elastic.co/u/Jan_Fiedler)\
**Post date:** [May 8, 2012, 1:43pm UTC](https://discuss.elastic.co/t/adding-filter-to-existing-analyzer/7593/2 "2012-05-08T13:43:49Z")

</div>

I believe your best bet is to define a custom analyzer. Find documentation  
on how to set this up here[http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html](http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html).  
Your custom analyzer can use a similar filter chain as the default analyzer  
(but I am not sure whether and where this is documented).

---

<div class="post-metadata">

**Author:** ![barnybug](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@barnybug](https://discuss.elastic.co/u/barnybug)\
**Post date:** [May 8, 2012, 4:23pm UTC](https://discuss.elastic.co/t/adding-filter-to-existing-analyzer/7593/3 "2012-05-08T16:23:30Z")

</div>

Thanks. So my alternate question - is there a way of knowing what the  
default analyzers define in terms of tokenizers/filters?

Digging into the code suggest they delegate to Lucene's built-in analyzers  
(e.g. EnglishAnalyzer for english), which is fairly opaque as to what it's  
doing..

Barnaby

On Tuesday, 8 May 2012 14:43:49 UTC+1, Jan Fiedler wrote:

> I believe your best bet is to define a custom analyzer. Find documentation  
> on how to set this up here[http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html](http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html).  
> Your custom analyzer can use a similar filter chain as the default analyzer  
> (but I am not sure whether and where this is documented).

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 10, 2012, 6:00am UTC](https://discuss.elastic.co/t/adding-filter-to-existing-analyzer/7593/4 "2012-05-10T06:00:30Z")

</div>

Here is what is used for the EnglishAnalyzer:

tokenizer: standard  
filter: standard, stemmer (possessive\_english), lowercase, stop, porter\_stem

On Tue, May 8, 2012 at 7:23 PM, barnybug [barnybug@googlemail.com](mailto:barnybug@googlemail.com) wrote:

> Thanks. So my alternate question - is there a way of knowing what the  
> default analyzers define in terms of tokenizers/filters?
> 
> Digging into the code suggest they delegate to Lucene's built-in analyzers  
> (e.g. EnglishAnalyzer for english), which is fairly opaque as to what it's  
> doing..
> 
> Barnaby
> 
> On Tuesday, 8 May 2012 14:43:49 UTC+1, Jan Fiedler wrote:
> 
> > I believe your best bet is to define a custom analyzer. Find  
> > documentation on how to set this up here[http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html](http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html).  
> > Your custom analyzer can use a similar filter chain as the default analyzer  
> > (but I am not sure whether and where this is documented).

---

<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, 3:29am UTC](https://discuss.elastic.co/t/adding-filter-to-existing-analyzer/7593/5 "2017-07-06T03:29:31Z")

</div>


