# Custom Token Filter: selectively remove .(dot) at end of word or catenate letter around .(dot)

**URL:** https://discuss.elastic.co/t/custom-token-filter-selectively-remove-dot-at-end-of-word-or-catenate-letter-around-dot/21061
**Category:** Elasticsearch
**Created:** [December 3, 2014, 2:37pm UTC](https://discuss.elastic.co/t/custom-token-filter-selectively-remove-dot-at-end-of-word-or-catenate-letter-around-dot/21061 "2014-12-03T14:37:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jade\_Tremblay](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Jade\_Tremblay](https://discuss.elastic.co/u/Jade_Tremblay)
#### Post date: [December 3, 2014, 2:37pm UTC](https://discuss.elastic.co/t/custom-token-filter-selectively-remove-dot-at-end-of-word-or-catenate-letter-around-dot/21061/1 "2014-12-03T14:37:03Z")

</div>

Hello,

I have created a custom analyzer with (tokenizer: whitespace).  
I would like to remove dot only at the end of words AND catenate  
letter/words if dot are between letters (ex: a.b.c =\> abc).  
What is the way to handle this in ES?  
I have try word\_delimiter but it split words as soon as a dot is hit, I  
don't wan't this behaviour.

Here is an example:

Sentence "the quick brown. fox.asd"

With actual analyzer, it gives

the 1quick 2brown. 3fox.asd 4

I would like to have  
the 1quick 2brown 3foxasd 4

"html\_exact\_analyser": {  
"char\_filter": [  
"html\_strip"  
],  
"filter": [  
"lowercase",  
"asciifolding"  
],  
"tokenizer": "whitespace"  
},

--  
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/f04e68db-28a0-4870-b623-4ddd97037ee4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f04e68db-28a0-4870-b623-4ddd97037ee4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Jade\_Tremblay](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Jade\_Tremblay](https://discuss.elastic.co/u/Jade_Tremblay)
#### Post date: [December 3, 2014, 3:41pm UTC](https://discuss.elastic.co/t/custom-token-filter-selectively-remove-dot-at-end-of-word-or-catenate-letter-around-dot/21061/2 "2014-12-03T15:41:04Z")

</div>

I've been able to figure out how to do this with a char\_filter

ref: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-pattern-replace-charfilter.html)

"char\_filter": {  
"remove\_dot\_pattern": {  
"type": "pattern\_replace",  
"pattern": ".",  
"replacement": ""  
}  
}

Le mercredi 3 décembre 2014 09:37:03 UTC-5, Jade Tremblay a écrit :

> Hello,
> 
> I have created a custom analyzer with (tokenizer: whitespace).  
> I would like to remove dot only at the end of words AND catenate  
> letter/words if dot are between letters (ex: a.b.c =\> abc).  
> What is the way to handle this in ES?  
> I have try word\_delimiter but it split words as soon as a dot is hit, I  
> don't wan't this behaviour.
> 
> Here is an example:
> 
> Sentence "the quick brown. fox.asd"
> 
> With actual analyzer, it gives
> 
> the 1quick 2brown. 3fox.asd 4
> 
> I would like to have  
> the 1quick 2brown 3foxasd 4
> 
> "html\_exact\_analyser": {  
> "char\_filter": [  
> "html\_strip"  
> ],  
> "filter": [  
> "lowercase",  
> "asciifolding"  
> ],  
> "tokenizer": "whitespace"  
> },

--  
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/7c9d0ede-e5a6-410d-9770-7f44b9ad4871%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c9d0ede-e5a6-410d-9770-7f44b9ad4871%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:46am UTC](https://discuss.elastic.co/t/custom-token-filter-selectively-remove-dot-at-end-of-word-or-catenate-letter-around-dot/21061/3 "2017-07-06T00:46:10Z")

</div>


