# I have created a new search box specific to one field search, exact search. how can i make it case insensitive?

**URL:** <https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [August 10, 2022, 7:05pm UTC](https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870 "2022-08-10T19:05:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)\
**Post date:** [August 10, 2022, 7:05pm UTC](https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870/1 "2022-08-10T19:05:05Z")

</div>

I have created 2 search box with react-search-ui out of box library.  
one search for specific field search with exact match and other generic search that search all, like below :

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/3/f325429b66a0c59b157dbb44666cebac34bebe35.png)

Since the exact search is implemented using below:  
onClick={() =\> {  
setFilter(field, value);  
}}

Is there a way to make the search insensitive ? or can i change the setFilter to something else to work ?

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [August 10, 2022, 7:32pm UTC](https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870/2 "2022-08-10T19:32:30Z")

</div>

Are you able to normalize your data?

So normalize the source field to be lower-case, and then also lower-case your filter value before applying it.

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [August 10, 2022, 7:33pm UTC](https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870/3 "2022-08-10T19:33:32Z")

</div>

Another thing to try would be try quoting the keyword:

```auto
onClick={() => {
  setSearchTerm(`"{value}"`);
}}

```

Not sure how that would work, but something to try.

---

<div class="post-metadata">

**Author:** ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)\
**Post date:** [August 10, 2022, 7:58pm UTC](https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870/4 "2022-08-10T19:58:40Z")

</div>

it doesnt filter on that specific field though right ?

---

<div class="post-metadata">

**Author:** ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)\
**Post date:** [August 10, 2022, 8:17pm UTC](https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870/5 "2022-08-10T20:17:18Z")

</div>

No we dont want to normalize the data. is it possible from the code base itself to do the case insentivity check ?

---

<div class="post-metadata">

**Author:** ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)\
**Post date:** [August 10, 2022, 8:20pm UTC](https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870/6 "2022-08-10T20:20:33Z")

</div>

where to set the field name on the setSearchTerm?

---

<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:** [September 7, 2022, 8:21pm UTC](https://discuss.elastic.co/t/i-have-created-a-new-search-box-specific-to-one-field-search-exact-search-how-can-i-make-it-case-insensitive/311870/7 "2022-09-07T20:21:01Z")

</div>

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