# Faceted search aggregation single text field separated values

**URL:** <https://discuss.elastic.co/t/faceted-search-aggregation-single-text-field-separated-values/163738>\
**Category:** Elasticsearch\
**Created:** [January 10, 2019, 1:10pm UTC](https://discuss.elastic.co/t/faceted-search-aggregation-single-text-field-separated-values/163738 "2019-01-10T13:10:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktb](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@ktb](https://discuss.elastic.co/u/ktb)\
**Post date:** [January 10, 2019, 1:10pm UTC](https://discuss.elastic.co/t/faceted-search-aggregation-single-text-field-separated-values/163738/1 "2019-01-10T13:10:51Z")

</div>

Hy,

currently i create a faceted search for our Onlineshop.

I create Filters with the aggregation. It works fine.

But how can i make a filter from a field, where multiple values separated by special characters.

Example:

"speed": "slow#mid#fast"

Should look like

![lo](https://us1.discourse-cdn.com/elastic/original/3X/c/d/cd581c3fb0ca451807f845f7631c99ca23677c03.jpeg)

Or isnt it a good idea, to use that?

Greetings  
ktb

---

<div class="post-metadata">

**Author:** ![ktb](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@ktb](https://discuss.elastic.co/u/ktb)\
**Post date:** [January 11, 2019, 7:59am UTC](https://discuss.elastic.co/t/faceted-search-aggregation-single-text-field-separated-values/163738/2 "2019-01-11T07:59:25Z")

</div>

I solved it.

in my mapping i've added this

```
"speed": {
      "type": "text",
      "fields":{
        "raw": {
          "type" : "keyword"
        }
      }
    },

```

and in the search query....

```
"aggs":{
    "locationFilter":{
        "terms": { 
             "field": "speed.raw"
        }
    }
}

```

Easier then i thought.

---

<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:** [February 8, 2019, 7:59am UTC](https://discuss.elastic.co/t/faceted-search-aggregation-single-text-field-separated-values/163738/3 "2019-02-08T07:59:33Z")

</div>

Closed on February 8, 2019, 7:59am UTC

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