# PatternReplaceFilter behaviour

**URL:** <https://discuss.elastic.co/t/patternreplacefilter-behaviour/10329>\
**Category:** Elasticsearch\
**Created:** [January 14, 2013, 8:57am UTC](https://discuss.elastic.co/t/patternreplacefilter-behaviour/10329 "2013-01-14T08:57:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Varun\_Thacker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varun_thacker/32/2472_2.png) [@Varun\_Thacker](https://discuss.elastic.co/u/Varun_Thacker)\
**Post date:** [January 14, 2013, 8:57am UTC](https://discuss.elastic.co/t/patternreplacefilter-behaviour/10329/1 "2013-01-14T08:57:10Z")

</div>

I was going through [https://github.com/elasticsearch/elasticsearch/pull/1108](https://github.com/elasticsearch/elasticsearch/pull/1108)

It's mentioned there that "By default the replacement expression is an  
empty string."

My question is the same as what @ timbunce comment is?

Also what if I put a stopword in the "replacement" parameter and use a stop  
filter after it in the analysis chain?

--

Regards,  
Varun Thacker  
[http://www.vthacker.in/](http://www.vthacker.in/)

--

---

<div class="post-metadata">

**Author:** ![benjamin\_leviant](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@benjamin\_leviant](https://discuss.elastic.co/u/benjamin_leviant)\
**Post date:** [January 15, 2013, 9:07am UTC](https://discuss.elastic.co/t/patternreplacefilter-behaviour/10329/2 "2013-01-15T09:07:13Z")

</div>

Hi,

I don't recommend you to use the TOTO nor for removing tokens nor for  
replacing tokens by other tokens. Filters exist just for that purpose, for  
example for removing tokens TATA and TITI and for replacing tokens TUTU.

In my opinion, it should be used only when you "need" the power of pattern  
matching for applying transformations to tokens.

Regards

Benjamin

--

---

<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, 2:56am UTC](https://discuss.elastic.co/t/patternreplacefilter-behaviour/10329/3 "2017-07-06T02:56:24Z")

</div>


