# Is a value stored twice when using a tolowercase normalizer on keywords?

**URL:** <https://discuss.elastic.co/t/is-a-value-stored-twice-when-using-a-tolowercase-normalizer-on-keywords/251884>\
**Category:** Elasticsearch\
**Created:** [October 13, 2020, 10:01am UTC](https://discuss.elastic.co/t/is-a-value-stored-twice-when-using-a-tolowercase-normalizer-on-keywords/251884 "2020-10-13T10:01:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanglingNode](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@DanglingNode](https://discuss.elastic.co/u/DanglingNode)\
**Post date:** [October 13, 2020, 10:01am UTC](https://discuss.elastic.co/t/is-a-value-stored-twice-when-using-a-tolowercase-normalizer-on-keywords/251884/1 "2020-10-13T10:01:31Z")

</div>

Hi all,  
I'm using a 'tolowercase' normalizer upon index (mapping) time to be able to find documents with value 'John Doe' when searching for 'john doe'.

**Upon index creation:**

```auto
       client.Indices.Create(
                    "some_index", 
                    c => c
                        .Settings(s => s
                            .Analysis(a => a
                                .Normalizers(n => n
                                    .Custom("lowercase", cn => cn.Filters("lowercase")))))

                        .Map<Person>(m => m.AutoMap())
                    );

```

**The person object:**

```auto
internal class Person {
    [Keyword(Normalizer = "lowercase")]
    public string Name {get; set;}
}

```

Does this mean more storage is used for the fields with this normalizer defined? So for documents having 'John Doe' as name. Will this value be stored as 'John Doe' and 'john doe'? Or does the normalization happen upon search computation time?

If the value is stored twice, are there other (better) solutions to avoid having to store more tokens?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [October 13, 2020, 10:43am UTC](https://discuss.elastic.co/t/is-a-value-stored-twice-when-using-a-tolowercase-normalizer-on-keywords/251884/2 "2020-10-13T10:43:15Z")

</div>

> [@DanglingNode](#):
>
> Does this mean more storage is used for the fields with this normalizer defined?

No, normalising typically reduces disk space because the search index doesn't contain all the case variations that might exist in different documents. Think of it like the word index at the back of a book - it would be bigger if it listed both page 10's `Aardvark` and page 33's `aardvark` as different entries

---

<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:** [November 10, 2020, 10:43am UTC](https://discuss.elastic.co/t/is-a-value-stored-twice-when-using-a-tolowercase-normalizer-on-keywords/251884/3 "2020-11-10T10:43:38Z")

</div>

Closed on November 10, 2020, 10:43am UTC

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