# String analyzer behaves unexpectedly

**URL:** <https://discuss.elastic.co/t/string-analyzer-behaves-unexpectedly/36266>\
**Category:** Elasticsearch\
**Created:** [December 3, 2015, 9:34am UTC](https://discuss.elastic.co/t/string-analyzer-behaves-unexpectedly/36266 "2015-12-03T09:34:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav\_Arora](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaurav_arora/32/1492_2.png) [@Gaurav\_Arora](https://discuss.elastic.co/u/Gaurav_Arora)\
**Post date:** [December 3, 2015, 9:34am UTC](https://discuss.elastic.co/t/string-analyzer-behaves-unexpectedly/36266/1 "2015-12-03T09:34:21Z")

</div>

I have a custom analyzer which I use on the field `name`. This analyzer uses `standard`, `lowercase`, `stop`, `trim` and `snowball` filters. The tokenizer used is `standard`.

I have two documents which are:

1. Bikanervala
2. State Bank of Bikaner

When I search for the term, 'bikaner' , shouldn't both these records match and not just the second one? Am I using the wrong analyzer?

---

<div class="post-metadata">

**Author:** ![sandros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandros/32/6348_2.png) [@sandros](https://discuss.elastic.co/u/sandros)\
**Post date:** [December 3, 2015, 2:25pm UTC](https://discuss.elastic.co/t/string-analyzer-behaves-unexpectedly/36266/2 "2015-12-03T14:25:12Z")

</div>

Just test it (it= your analyzer) with:  
GET my\_index/\_analyze?field=name  
{  
"text": [...your 2 example.s..."]  
}

then you see exactly what you get.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 5, 2015, 12:05am UTC](https://discuss.elastic.co/t/string-analyzer-behaves-unexpectedly/36266/3 "2015-12-05T00:05:02Z")

</div>

I'm not 100% sure that snowball would know what to do with `Bikanervala`, [what language](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-snowball-tokenfilter.html) is it from?

---

<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 5, 2017, 11:33pm UTC](https://discuss.elastic.co/t/string-analyzer-behaves-unexpectedly/36266/4 "2017-07-05T23:33:26Z")

</div>


