# String to Keywords

**URL:** https://discuss.elastic.co/t/string-to-keywords/122377
**Category:** Elasticsearch
**Created:** [March 3, 2018, 3:54pm UTC](https://discuss.elastic.co/t/string-to-keywords/122377 "2018-03-03T15:54:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![haldrich](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haldrich](https://discuss.elastic.co/u/haldrich)
#### Post date: [March 3, 2018, 3:54pm UTC](https://discuss.elastic.co/t/string-to-keywords/122377/1 "2018-03-03T15:54:19Z")

</div>

We have a situation where we used to use Not Analyzed string fields.  
The data in question looks like this: tag1,tag2,tag3  
It is used for aggregation and got stored in an array of values e.g. [tag1,tag2,tag3] because it used a comma separator analyzer that spit out tokens split on commas.

Fast forward to Elastic now with Text and Keyword types...  
We would like to make these Keyword types as they are not truly searched, just used for aggregation.  
However, it appears that there is no way for a keyword to be multiple tokens.

I'm aware that we can turn on FieldData for a text field.  
Is that our only choice, or is there some way to make use of the idea of Keywords instead of Text since we only want this data for aggregation.

Thanks.

---

<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 31, 2018, 3:54pm UTC](https://discuss.elastic.co/t/string-to-keywords/122377/2 "2018-03-31T15:54:21Z")

</div>

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