# Doc values for lowercase string in ES 2.4

**URL:** <https://discuss.elastic.co/t/doc-values-for-lowercase-string-in-es-2-4/73799>\
**Category:** Elasticsearch\
**Created:** [February 3, 2017, 7:03am UTC](https://discuss.elastic.co/t/doc-values-for-lowercase-string-in-es-2-4/73799 "2017-02-03T07:03:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashokm](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@ashokm](https://discuss.elastic.co/u/ashokm)\
**Post date:** [February 3, 2017, 7:03am UTC](https://discuss.elastic.co/t/doc-values-for-lowercase-string-in-es-2-4/73799/1 "2017-02-03T07:03:58Z")

</div>

Hi All,

We have been using ES 1.4.2 and we are in the process of migrating to 2.4.4. We have the following mappings for all the string fields

```
  "analysis": {
    "analyzer": {
      "op_analyzer": {
        "filter": [
          "lowercase"
        ],
        "tokenizer": "keyword"
      }
    }
  }

 "title": {
      "index": "not_analyzed",
      "type": "string",
      "fields": {
        "lc": {
          "analyzer": "op_analyzer", // See, above
          "type": "string"
        },
        "stopwordanalyzed": {
          "analyzer": "stop",
          "type": "string"
        },
        "snowballanalyzed": {
          "analyzer": "snowball",
          "type": "string"
        }
      }
    }

```

If we carry forward the same mapping, I realize that we will not be able to take advantage of doc values on '[title.lc](http://title.lc)' field during aggregations. What is the best way to achieve doc value support for lowercase values?

Any help is really appreciated

Thanks in advance  
Ashok

---

<div class="post-metadata">

**Author:** ![Mikolaj\_Kocikowski](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Mikolaj\_Kocikowski](https://discuss.elastic.co/u/Mikolaj_Kocikowski)\
**Post date:** [February 3, 2017, 8:27pm UTC](https://discuss.elastic.co/t/doc-values-for-lowercase-string-in-es-2-4/73799/2 "2017-02-03T20:27:04Z")

</div>

Ashok, you need to lowercase your "title" before indexing it. Applying any analysis makes the field ineligible for doc\_values

---

<div class="post-metadata">

**Author:** ![ashokm](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@ashokm](https://discuss.elastic.co/u/ashokm)\
**Post date:** [February 3, 2017, 8:49pm UTC](https://discuss.elastic.co/t/doc-values-for-lowercase-string-in-es-2-4/73799/3 "2017-02-03T20:49:40Z")

</div>

Thanks for the reply Mik. To avoid impact on client code, is there a way to force ES to populate lowercase values during indexing via transformation or some other mechanism on '[title.lc](http://title.lc)' (Note that, 'lc' is one of the multi fields in 'title')

Since we are going to re-index the data, i have flexibility in changing the mappings

---

<div class="post-metadata">

**Author:** ![Mikolaj\_Kocikowski](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Mikolaj\_Kocikowski](https://discuss.elastic.co/u/Mikolaj_Kocikowski)\
**Post date:** [February 3, 2017, 9:09pm UTC](https://discuss.elastic.co/t/doc-values-for-lowercase-string-in-es-2-4/73799/4 "2017-02-03T21:09:33Z")

</div>

Not that I know of, in 2.x

---

<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:** [March 3, 2017, 9:09pm UTC](https://discuss.elastic.co/t/doc-values-for-lowercase-string-in-es-2-4/73799/5 "2017-03-03T21:09:45Z")

</div>

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