# Unable to query on \<field\>.keyword for certain indices

**URL:** <https://discuss.elastic.co/t/unable-to-query-on-field-keyword-for-certain-indices/93659>\
**Category:** Elasticsearch\
**Created:** [July 18, 2017, 7:27pm UTC](https://discuss.elastic.co/t/unable-to-query-on-field-keyword-for-certain-indices/93659 "2017-07-18T19:27:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anishi\_Mehta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anishi_mehta/32/20136_2.png) [@Anishi\_Mehta](https://discuss.elastic.co/u/Anishi_Mehta)\
**Post date:** [July 18, 2017, 7:27pm UTC](https://discuss.elastic.co/t/unable-to-query-on-field-keyword-for-certain-indices/93659/1 "2017-07-18T19:27:11Z")

</div>

Hi,

I have a non-analyzed string field _xyz_ which elasticsearch broke down into two _xyz_ (which is analyzed) and _xyz_.keyword (which is not analyzed). I want to do regex queries on this field i.e. on the non-analyzed field, but these queries work only for one index, and none other. I used Python interface to populate the database. The format of all the files, code used, and structure of the index are the same for all.

I checked the index mapping and somehow, only the first index shows _xyz_ to be a "keyword" type, all the other indices do not. My code is still the same. This happens with only two fields, not all.

Please help as I cannot understand this.

---

<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:** [August 15, 2017, 7:37pm UTC](https://discuss.elastic.co/t/unable-to-query-on-field-keyword-for-certain-indices/93659/2 "2017-08-15T19:37:46Z")

</div>

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