# Changed many index field to Keywords now cannot query in KQL

**URL:** <https://discuss.elastic.co/t/changed-many-index-field-to-keywords-now-cannot-query-in-kql/230543>\
**Category:** Kibana\
**Tags:** kql-kibana-query-language\
**Created:** [April 30, 2020, 12:17pm UTC](https://discuss.elastic.co/t/changed-many-index-field-to-keywords-now-cannot-query-in-kql/230543 "2020-04-30T12:17:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoyomonkey](https://avatars.discourse-cdn.com/v4/letter/y/8baadc/32.png) [@yoyomonkey](https://discuss.elastic.co/u/yoyomonkey)\
**Post date:** [April 30, 2020, 12:17pm UTC](https://discuss.elastic.co/t/changed-many-index-field-to-keywords-now-cannot-query-in-kql/230543/1 "2020-04-30T12:17:22Z")

</div>

Hi I hope someone can help me. Apologies as it may be a stupid question and i am still learning.

Would anyone happen to have some simple guide or explanation they can point me to to explain why this is happening ?

I have following this type of record

```
  "_type": "_doc",
  "_id": "49606120302139348740181899632196521286098133251673554946.0",
  "_version": 1,
  "_score": null,
  "_source": {
    "timestamp": "2020-04-30 10:48:25,244",
    "action": "OAuth",
    "unknown1": " 1234567890",
    "ipaddress": " 127.0.0.1 ",
    "unknown2": " ",
    "device": " pa_customer",
    "authenticationtype": " OAuth20",
    "hosttype": " localhost",
    "providertype": " AS",
    "result": " success",
    "typemfa": " ProductHoldingAFM2FA",
    "message": " ",
    "duration": " 2596"
  },
  "fields": {
    "timestamp": [
      "2020-04-30T10:48:25.244Z"
    ]
  },
  "sort": [
    1588243705244
  ]
}

```

and i recently changed most fields as they are single words to "keyword" fields.

I can create a filter and that works but if i wanted to do a search in KQL command like  
`result: success`

or  
`result:sucesss`  
i get nothing?

I would expect the search give me all records that have result as success. It worked before when these fields were set to text and not keyword but now that i want these fields as aggregatable to make piecharts etc it is not.

If I wanted to type a KQL command to give me all events with a specific field name value what would i need to type.

Apologies I am just getting really confused and I am trying to follow a kibana tutorial and commands dont seem to be working for me.

My index patterns in kibana show all relevant fields including result as searchable and aggregatable

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![yoyomonkey](https://avatars.discourse-cdn.com/v4/letter/y/8baadc/32.png) [@yoyomonkey](https://discuss.elastic.co/u/yoyomonkey)\
**Post date:** [April 30, 2020, 12:56pm UTC](https://discuss.elastic.co/t/changed-many-index-field-to-keywords-now-cannot-query-in-kql/230543/2 "2020-04-30T12:56:02Z")

</div>

I am such a newb apologies ..... but i am here posting to correct myself but if anyone has any good links or tutorials to follow for this version of kibana i would really appreciate it.

Anyway i think the reason it was not working as I wasnt getting the terms exact so I had to search for

`action:OAuth`

not

`action:oauth`

I thought when it came to tokenizing they would go down to lowercase but i presume that is for text not for keyword now.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 4, 2020, 9:23pm UTC](https://discuss.elastic.co/t/changed-many-index-field-to-keywords-now-cannot-query-in-kql/230543/3 "2020-05-04T21:23:18Z")

</div>

> [@yoyomonkey](#):
>
> but i presume that is for text not for keyword now.

You are correct in that assumption. Hey, it's a good lesson to learn early.

---

<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:** [June 1, 2020, 9:23pm UTC](https://discuss.elastic.co/t/changed-many-index-field-to-keywords-now-cannot-query-in-kql/230543/4 "2020-06-01T21:23:20Z")

</div>

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