# Is it possible to write my own filter?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-write-my-own-filter/22630>\
**Category:** Elasticsearch\
**Created:** [March 12, 2015, 9:43am UTC](https://discuss.elastic.co/t/is-it-possible-to-write-my-own-filter/22630 "2015-03-12T09:43:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cornet\_remi](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@cornet\_remi](https://discuss.elastic.co/u/cornet_remi)\
**Post date:** [March 12, 2015, 9:43am UTC](https://discuss.elastic.co/t/is-it-possible-to-write-my-own-filter/22630/1 "2015-03-12T09:43:35Z")

</div>

Hi everyone,

I need a filter to split in two words a word containing a suffix that  
belongs to a list (Maybe a text file containing all the suffix) but I can't  
find an existing filter doing that.

Does anyone have a solution to this?  
If not, is there a way to write my own filter in Java and add it to  
ElasticSearch ? : )

--  
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/ef12f3ec-1210-4890-8f52-49cb5d7243d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ef12f3ec-1210-4890-8f52-49cb5d7243d1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [March 12, 2015, 11:32am UTC](https://discuss.elastic.co/t/is-it-possible-to-write-my-own-filter/22630/2 "2015-03-12T11:32:12Z")

</div>

Off the top of my head, I cannot think of an existing filter that  
accomplishes that task.

Creating a custom filter is easy. Simply creating a Lucene filter and  
create a plug-in around it. Take a look at existing analysis plug-ins for  
inspiration.

> **[Plugins | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-plugins.html#analysis-plugins)**

Cheers,

Ivan  
On Mar 12, 2015 11:43 AM, [cornet.remi@gmail.com](mailto:cornet.remi@gmail.com) wrote:

> Hi everyone,
> 
> I need a filter to split in two words a word containing a suffix that  
> belongs to a list (Maybe a text file containing all the suffix) but I can't  
> find an existing filter doing that.
> 
> Does anyone have a solution to this?  
> If not, is there a way to write my own filter in Java and add it to  
> Elasticsearch ? : )
> 
> --  
> 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/ef12f3ec-1210-4890-8f52-49cb5d7243d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ef12f3ec-1210-4890-8f52-49cb5d7243d1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/ef12f3ec-1210-4890-8f52-49cb5d7243d1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/ef12f3ec-1210-4890-8f52-49cb5d7243d1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CALY%3DcQB9QcgC-d%3DkE36U04k9\_S1QrzdZbEj\_%3Dk2UCtrOSz8b3A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQB9QcgC-d%3DkE36U04k9_S1QrzdZbEj_%3Dk2UCtrOSz8b3A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 12, 2015, 1:15pm UTC](https://discuss.elastic.co/t/is-it-possible-to-write-my-own-filter/22630/3 "2015-03-12T13:15:31Z")

</div>

I wonder if you could use a Pattern Tokenizer in that case???

> **[Pattern tokenizer | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pattern-tokenizer.html)**

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 12 mars 2015 à 04:32, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) a écrit :
> 
> Off the top of my head, I cannot think of an existing filter that accomplishes that task.
> 
> Creating a custom filter is easy. Simply creating a Lucene filter and create a plug-in around it. Take a look at existing analysis plug-ins for inspiration.
> 
> [Plugins | Elasticsearch Guide [8.11] | Elastic](http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-plugins.html#analysis-plugins)
> 
> Cheers,
> 
> Ivan
> 
> > On Mar 12, 2015 11:43 AM, [cornet.remi@gmail.com](mailto:cornet.remi@gmail.com) wrote:  
> > Hi everyone,
> > 
> > I need a filter to split in two words a word containing a suffix that belongs to a list (Maybe a text file containing all the suffix) but I can't find an existing filter doing that.
> > 
> > Does anyone have a solution to this?  
> > If not, is there a way to write my own filter in Java and add it to Elasticsearch ? : )
> > 
> > --  
> > 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/ef12f3ec-1210-4890-8f52-49cb5d7243d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ef12f3ec-1210-4890-8f52-49cb5d7243d1%40googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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/CALY%3DcQB9QcgC-d%3DkE36U04k9\_S1QrzdZbEj\_%3Dk2UCtrOSz8b3A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQB9QcgC-d%3DkE36U04k9_S1QrzdZbEj_%3Dk2UCtrOSz8b3A%40mail.gmail.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/5AF81E5A-912E-4CD0-9E06-C3730C62433E%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/5AF81E5A-912E-4CD0-9E06-C3730C62433E%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![cornet\_remi](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@cornet\_remi](https://discuss.elastic.co/u/cornet_remi)\
**Post date:** [March 13, 2015, 9:03am UTC](https://discuss.elastic.co/t/is-it-possible-to-write-my-own-filter/22630/4 "2015-03-13T09:03:39Z")

</div>

Yes, that's an idea : )  
Pattern Tokenizer seems to give the results I want but I don't know if it's  
possible to define patterns based on a list of specific words.

--  
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/f160d9eb-d3ef-48f8-899c-259a8fa90406%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f160d9eb-d3ef-48f8-899c-259a8fa90406%40googlegroups.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:27am UTC](https://discuss.elastic.co/t/is-it-possible-to-write-my-own-filter/22630/5 "2017-07-06T00:27:03Z")

</div>


