# Case-insensitive search on not\_analyzed field

**URL:** <https://discuss.elastic.co/t/case-insensitive-search-on-not-analyzed-field/12644>\
**Category:** Elasticsearch\
**Created:** [July 3, 2013, 1:39pm UTC](https://discuss.elastic.co/t/case-insensitive-search-on-not-analyzed-field/12644 "2013-07-03T13:39:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit\_Jain](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Ankit\_Jain](https://discuss.elastic.co/u/Ankit_Jain)\
**Post date:** [July 3, 2013, 1:39pm UTC](https://discuss.elastic.co/t/case-insensitive-search-on-not-analyzed-field/12644/1 "2013-07-03T13:39:54Z")

</div>

Hi All,

I would like to perform case insensitive search on not\_analyzed field, as  
well as I would like to provide support for wildcard search. And, wildcard  
search is not working on keyword analyzer.

Also, I tried by using query string query, but it would not giving expected  
search result.

Thanks,  
Ankit Jain

--  
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:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [July 3, 2013, 9:53pm UTC](https://discuss.elastic.co/t/case-insensitive-search-on-not-analyzed-field/12644/2 "2013-07-03T21:53:50Z")

</div>

Ankit,

You'll need to analyze a field to search case-insensitive.

You can always use multi-field mapping and create two mappings for one  
field: One of the mappings is analyzed one way (such as the way you need to  
search), and the other is analyzed differently or not at all.

Brian

On Wednesday, July 3, 2013 9:39:54 AM UTC-4, Ankit Jain wrote:

> Hi All,
> 
> I would like to perform case insensitive search on not\_analyzed field, as  
> well as I would like to provide support for wildcard search. And, wildcard  
> search is not working on keyword analyzer.
> 
> Also, I tried by using query string query, but it would not giving  
> expected search result.
> 
> Thanks,  
> Ankit Jain

--  
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:** ![Ben\_Hundley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben_hundley/32/1853_2.png) [@Ben\_Hundley](https://discuss.elastic.co/u/Ben_Hundley)\
**Post date:** [July 5, 2013, 3:38pm UTC](https://discuss.elastic.co/t/case-insensitive-search-on-not-analyzed-field/12644/3 "2013-07-05T15:38:16Z")

</div>

The mapping for such a scenario would like like this:

{  
type\_name: {  
properties: {  
type: "multi\_field",  
fields: {  
field\_name\_searchable: { type: "string" },  
field\_name\_untouched: { type: "string", index: "not\_analyzed" }  
}  
}  
}  
}

If you take a look at the [Standard Analyzer page](http://www.elasticsearch.org/guide/reference/index-modules/analysis/standard-analyzer/), you'll notice that case insensitive search is enabled by default (with the Lowercase tokenizer). The mapping defined above will allow you to perform wildcard and case-insensitive search on "field\_name\_searchable" as well as giving you literal matches on "field\_name\_untouched".

Hope that answers your question.

---

<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:27am UTC](https://discuss.elastic.co/t/case-insensitive-search-on-not-analyzed-field/12644/4 "2017-07-06T02:27:59Z")

</div>


