# Problem with keyword\_repeat filter

**URL:** <https://discuss.elastic.co/t/problem-with-keyword-repeat-filter/11836>\
**Category:** Elasticsearch\
**Created:** [May 6, 2013, 2:03pm UTC](https://discuss.elastic.co/t/problem-with-keyword-repeat-filter/11836 "2013-05-06T14:03:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel\_Gellfart](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Manuel\_Gellfart](https://discuss.elastic.co/u/Manuel_Gellfart)\
**Post date:** [May 6, 2013, 2:03pm UTC](https://discuss.elastic.co/t/problem-with-keyword-repeat-filter/11836/1 "2013-05-06T14:03:13Z")

</div>

Hello,

I am experiencing a problem (maybe bug?) with the new keyword\_repeat filter.

The Documentation  
[http://www.elasticsearch.org/guide/reference/index-modules/analysis/keyword-repeat-tokenfilter/](http://www.elasticsearch.org/guide/reference/index-modules/analysis/keyword-repeat-tokenfilter/)says:

The keyword\_repeat token filter Emits each incoming token twice once as

> keyword and once as a non-keyword to allow an un-stemmed version of a term  
> to be indexed side by site to the stemmed version of the term.

Thats exactly what I want. So i defined a small test Analyzer "test":

settings: {  
index: {  
analysis: {  
analyzer: {  
bcsTicketAnalyzer2: {  
type: 'custom',  
tokenizer: 'whitespace',  
filter: [  
'lowercase',  
'keyword\_repeat',  
'replacePattern'

```
        ]
      }

```

},  
filter: {  
replacePattern: {  
type: 'pattern\_replace',  
pattern: '[!"#$%&'()\*+,./:;\<=\>?@^\_`{|}~-]',  
replacement: ' '  
}  
}  
}  
}  
}

Elastic Search accepts this setting and I tested it with a single word  
"F-I-TS".  
I Expected something like this as result:

{  
"tokens" : [ {  
"token" : "f-i-ts",  
"start\_offset" : 0,  
"end\_offset" : 6,  
"type" : "word",  
"position" : 1  
}, {  
"token" : "f i ts",  
"start\_offset" : 0,  
"end\_offset" : 6,  
"type" : "word",  
"position" : 1  
} ]  
}

But I get this as Result:  
{  
"tokens" : [ {  
"token" : "f i ts",  
"start\_offset" : 0,  
"end\_offset" : 6,  
"type" : "word",  
"position" : 1  
}, {  
"token" : "f i ts",  
"start\_offset" : 0,  
"end\_offset" : 6,  
"type" : "word",  
"position" : 1  
} ]  
}

This means, that both keyword and non-keyword get postprocessed in the same way.  
How can I achieve my expected result? This is important for my usecase because people sometimes search for company names.

Thanks in Advance

Manuel

--  
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:** ![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:38am UTC](https://discuss.elastic.co/t/problem-with-keyword-repeat-filter/11836/2 "2017-07-06T02:38:06Z")

</div>


