# Fielddata on a custom analyzer that is of keyword tokenizer

**URL:** <https://discuss.elastic.co/t/fielddata-on-a-custom-analyzer-that-is-of-keyword-tokenizer/325846>\
**Category:** Elasticsearch\
**Created:** [February 17, 2023, 1:35pm UTC](https://discuss.elastic.co/t/fielddata-on-a-custom-analyzer-that-is-of-keyword-tokenizer/325846 "2023-02-17T13:35:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![drjz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drjz/32/972_2.png) [@drjz](https://discuss.elastic.co/u/drjz)\
**Post date:** [February 17, 2023, 1:35pm UTC](https://discuss.elastic.co/t/fielddata-on-a-custom-analyzer-that-is-of-keyword-tokenizer/325846/1 "2023-02-17T13:35:18Z")

</div>

I created a custom analyzer that does lowercasing. The reason why I did not use a normalizer is because I need to apply stopword filter that the normalizer is not supporting.

```auto
"lowercase_analyzer": {
                    "type": "custom",
                    "tokenizer": "keyword",
                    "filter": [
                        "truncate",
                        "stopwords",
                        "lowercase"
                    ]
                },

```

I define a subfield with the custom analyzer as follow:

```auto
"normalized": {
                      "analyzer": "lowercase_analyzer",
                      "type": "text",
                      "fielddata": true
                    },

```

But I have my doubts about using fielddata. Ideally, I want to use the doc\_values for the aggregations. Since this is a fieldtype of `text`, this is not possible. How much will adding `fielddata` hurt the stability and performance? Does anyone know another solution?

---

<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 17, 2023, 1:35pm UTC](https://discuss.elastic.co/t/fielddata-on-a-custom-analyzer-that-is-of-keyword-tokenizer/325846/2 "2023-03-17T13:35:58Z")

</div>

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