Faceted search aggregation single text field separated values

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

Or isnt it a good idea, to use that?

Greetings
ktb

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.

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