# How do I query the full field value using match as if I am searching using term, but it is not case sensitive?

**URL:** <https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240>\
**Category:** Elasticsearch\
**Created:** [January 15, 2025, 5:10pm UTC](https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240 "2025-01-15T17:10:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)\
**Post date:** [January 15, 2025, 5:10pm UTC](https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240/1 "2025-01-15T17:10:04Z")

</div>

Hi  
I want to query a field of type text using match, but I want to query the full text and also be case-insensitive  
What I mean is  
I have a search I want to search as if I am searching using the term but not sensitive to the case of letters

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 15, 2025, 5:21pm UTC](https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240/2 "2025-01-15T17:21:48Z")

</div>

Have you tried the [term query with case\_insensitive parameter set](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html#term-field-params) against the keyword mapped field/sub-field?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 15, 2025, 5:30pm UTC](https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240/3 "2025-01-15T17:30:07Z")

</div>

Case insensitive is the default behaviour.

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can **copy and paste in Kibana dev console** , click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Have a look at the [Elastic Stack and Solutions Help · Forums and Slack | Elastic](https://elastic.co/community/help) page. It contains also lot of useful information on how to ask for help.

---

<div class="post-metadata">

**Author:** ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)\
**Post date:** [January 15, 2025, 5:45pm UTC](https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240/5 "2025-01-15T17:45:18Z")

</div>

No, I haven't tried it.  
Can you give me an example of this because there is no clear example in the documents

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 15, 2025, 5:55pm UTC](https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240/6 "2025-01-15T17:55:19Z")

</div>

```auto
GET /_search
{
  "query": {
    "term": {
      "user.id": {
        "value": "kimchy",
        "case_insensitive": true,
        "boost": 1.0
      }
    }
  }
}

```

This assumes the `user.id` field is mapped as `keyword`.

---

<div class="post-metadata">

**Author:** ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)\
**Post date:** [January 15, 2025, 5:56pm UTC](https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240/7 "2025-01-15T17:56:40Z")

</div>

Let the example be like this

```auto
"full_text": "Quick Brown Foxes!"

```

Now I want to query assuming that the field already exists

```auto
GET my-index-000001/_search?pretty
{
  "query": {
    "match": {
      "full_text": "Quick Brown Foxes!"
    }
  }
}  

```

He will repeat without any problem  
the problem lies If you delete one of the words it will return results too and I don't want  
I want the data not to be returned unless it matches, regardless of whether it is small or large

---

<div class="post-metadata">

**Author:** ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)\
**Post date:** [January 15, 2025, 6:10pm UTC](https://discuss.elastic.co/t/how-do-i-query-the-full-field-value-using-match-as-if-i-am-searching-using-term-but-it-is-not-case-sensitive/373240/8 "2025-01-15T18:10:24Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> ```auto
> GET /_search
> {
> "query": {
> "term": {
> "user.id": {
> "value": "kimchy",
> "case_insensitive": true,
> "boost": 1.0
> }
> }
> }
> }
> 
> ```

Thank you

This has benefited me.
