# Adding NGram to language analyzer

**URL:** <https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980>\
**Category:** Elasticsearch\
**Created:** [July 29, 2013, 6:42am UTC](https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980 "2013-07-29T06:42:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shamun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shamun/32/2201_2.png) [@Shamun](https://discuss.elastic.co/u/Shamun)\
**Post date:** [July 29, 2013, 6:42am UTC](https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980/1 "2013-07-29T06:42:09Z")

</div>

Hi,  
I use the built-in Arabic analyzer to index my Arabic text.  
I want to add auto complete feature to my search, so I thought about adding  
NGram filter.  
Is it possible to extend existing analyzer?  
If no, what is the configuration of the Arabic analyzer?

Thanks!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 30, 2013, 6:58am UTC](https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980/2 "2013-07-30T06:58:28Z")

</div>

Hey,

You can create and configure your own custom analyzers and use them inside  
of your mapping, see

> **[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.

Note, you cannot change the analyzer configuration of a field, which has  
already data indexed. So you either need to recreate your index or use the  
so-called multi-field functionality. See

> **[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.

Hope this helps.

--Alex

On Mon, Jul 29, 2013 at 8:42 AM, Ido Shamun [idoesh1@gmail.com](mailto:idoesh1@gmail.com) wrote:

> Hi,  
> I use the built-in Arabic analyzer to index my Arabic text.  
> I want to add auto complete feature to my search, so I thought about adding  
> NGram filter.  
> Is it possible to extend existing analyzer?  
> If no, what is the configuration of the Arabic analyzer?
> 
> Thanks!
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Shamun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shamun/32/2201_2.png) [@Shamun](https://discuss.elastic.co/u/Shamun)\
**Post date:** [July 30, 2013, 7:06am UTC](https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980/3 "2013-07-30T07:06:34Z")

</div>

I know how to create custom analyzer and use multi-field.  
But I don't know what the Arabic analyzer configuration is. I found some  
references which aren't exact and give different indexing compared to the  
built-in one.  
On Jul 30, 2013 9:58 AM, "Alexander Reelsen" [alr@spinscale.de](mailto:alr@spinscale.de) wrote:

> Hey,
> 
> You can create and configure your own custom analyzers and use them inside  
> of your mapping, see  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer/)
> 
> Note, you cannot change the analyzer configuration of a field, which has  
> already data indexed. So you either need to recreate your index or use the  
> so-called multi-field functionality. See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/multi-field-type/)
> 
> Hope this helps.
> 
> --Alex
> 
> On Mon, Jul 29, 2013 at 8:42 AM, Ido Shamun [idoesh1@gmail.com](mailto:idoesh1@gmail.com) wrote:
> 
> > Hi,  
> > I use the built-in Arabic analyzer to index my Arabic text.  
> > I want to add auto complete feature to my search, so I thought about  
> > adding  
> > NGram filter.  
> > Is it possible to extend existing analyzer?  
> > If no, what is the configuration of the Arabic analyzer?
> > 
> > Thanks!
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/Ecu4p8Usj-o/unsubscribe](https://groups.google.com/d/topic/elasticsearch/Ecu4p8Usj-o/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [July 30, 2013, 8:04am UTC](https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980/4 "2013-07-30T08:04:33Z")

</div>

Hi,

may be this can help?

[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/analysis/ArabicAnalyzerProvider.java](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/analysis/ArabicAnalyzerProvider.java)  
[http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/ar/ArabicAnalyzer.java](http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/ar/ArabicAnalyzer.java)

Both links refer to the master/trunk.

Regards,  
Lukas

On Tue, Jul 30, 2013 at 9:06 AM, Ido Shamun [idoesh1@gmail.com](mailto:idoesh1@gmail.com) wrote:

> I know how to create custom analyzer and use multi-field.  
> But I don't know what the Arabic analyzer configuration is. I found some  
> references which aren't exact and give different indexing compared to the  
> built-in one.  
> On Jul 30, 2013 9:58 AM, "Alexander Reelsen" [alr@spinscale.de](mailto:alr@spinscale.de) wrote:
> 
> > Hey,
> > 
> > You can create and configure your own custom analyzers and use them  
> > inside of your mapping, see  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer/)
> > 
> > Note, you cannot change the analyzer configuration of a field, which has  
> > already data indexed. So you either need to recreate your index or use the  
> > so-called multi-field functionality. See  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/multi-field-type/)
> > 
> > Hope this helps.
> > 
> > --Alex
> > 
> > On Mon, Jul 29, 2013 at 8:42 AM, Ido Shamun [idoesh1@gmail.com](mailto:idoesh1@gmail.com) wrote:
> > 
> > > Hi,  
> > > I use the built-in Arabic analyzer to index my Arabic text.  
> > > I want to add auto complete feature to my search, so I thought about  
> > > adding  
> > > NGram filter.  
> > > Is it possible to extend existing analyzer?  
> > > If no, what is the configuration of the Arabic analyzer?
> > > 
> > > Thanks!
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/Ecu4p8Usj-o/unsubscribe](https://groups.google.com/d/topic/elasticsearch/Ecu4p8Usj-o/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Panagiotis\_Nikitopou](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@Panagiotis\_Nikitopou](https://discuss.elastic.co/u/Panagiotis_Nikitopou)\
**Post date:** [May 29, 2014, 8:05pm UTC](https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980/5 "2014-05-29T20:05:37Z")

</div>

I have the exact same problem with greek language.  
Have you figured out how to solve it?  
Thanks!

On Monday, July 29, 2013 9:42:09 AM UTC+3, Ido Shamun wrote:

> Hi,  
> I use the built-in Arabic analyzer to index my Arabic text.  
> I want to add auto complete feature to my search, so I thought about adding  
> NGram filter.  
> Is it possible to extend existing analyzer?  
> If no, what is the configuration of the Arabic analyzer?
> 
> Thanks!

--  
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/c95e5999-b920-497b-ab04-33423e7ceed8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c95e5999-b920-497b-ab04-33423e7ceed8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [May 30, 2014, 2:30pm UTC](https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980/6 "2014-05-30T14:30:16Z")

</div>

On Thu, May 29, 2014 at 4:05 PM, Panagiotis Nikitopoulos \<  
[panosbobos@gmail.com](mailto:panosbobos@gmail.com)\> wrote:

> I have the exact same problem with greek language.  
> Have you figured out how to solve it?  
> Thanks!

First build a copy of the greek analyzer as a custom analyzer. Have a look  
at  
[https://gerrit.wikimedia.org/r/#/c/130646/1/default\_analyzer\_config.json,cm](https://gerrit.wikimedia.org/r/#/c/130646/1/default_analyzer_config.json,cm)  
which contains an analyzer called custon\_greek which is exactly that. Copy  
that analzyer and all the filters that it needs (also in that file) from  
into your configuration. Rename as you like. Verify that it works as you  
expect. Start hacking on it to add your changes.

Nik

--  
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/CAPmjWd3D3PpsLcUo%2BvS81UGKXRJd3GeTPtUzYxUYnX7N8xHxhQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3D3PpsLcUo%2BvS81UGKXRJd3GeTPtUzYxUYnX7N8xHxhQ%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, 1:25am UTC](https://discuss.elastic.co/t/adding-ngram-to-language-analyzer/12980/7 "2017-07-06T01:25:46Z")

</div>


