# How to force a query\_string query to be case insensitive regardless of query body with icu\_analyzer?

**URL:** <https://discuss.elastic.co/t/how-to-force-a-query-string-query-to-be-case-insensitive-regardless-of-query-body-with-icu-analyzer/91269>\
**Category:** Elasticsearch\
**Created:** [June 29, 2017, 11:15am UTC](https://discuss.elastic.co/t/how-to-force-a-query-string-query-to-be-case-insensitive-regardless-of-query-body-with-icu-analyzer/91269 "2017-06-29T11:15:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mett](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mett](https://discuss.elastic.co/u/mett)\
**Post date:** [June 29, 2017, 11:15am UTC](https://discuss.elastic.co/t/how-to-force-a-query-string-query-to-be-case-insensitive-regardless-of-query-body-with-icu-analyzer/91269/1 "2017-06-29T11:15:38Z")

</div>

I have a text field (also a multifield with whitespace analyser on it but the query here is for the 'top-level' analysed text which uses icu\_analyser on elasticsearch 5.4)

The following queries yield different results:

```
	"query": {
		"bool": {
			"must": [{
				"query_string": {
					"query": "(my_stuff.body:trevor)"
				}
			}]
		}
	} 

```

I'd want the query to match on 'Trevor' and 'TREVOR' in docs too. This appears to be the behaviour on the standard analyser. How can I get this case-insensitive behaviour in icu\_analyzer fields?

---

<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 27, 2017, 11:16am UTC](https://discuss.elastic.co/t/how-to-force-a-query-string-query-to-be-case-insensitive-regardless-of-query-body-with-icu-analyzer/91269/2 "2017-07-27T11:16:38Z")

</div>

Closed on July 27, 2017, 11:16am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
