Indexing array list of tags (string)

#1

Hi,

I am stuck on indexing array of strings.

i have a field "tags" with array of strings as you can see on the following picture:

But after indexing it, i can't filter for specific values within the array.

For example if i want to create a simple pie chart to see the proportion of each tag accross the field i can't, it considers each array of string as a single value.

here is what i get :

i tried multiple way to index this field but i can't figure how to do it properly. In order to be able to filter for only one value of my array and not all the array.

I hope i'm clear.
I'm using Python API to index my doc.

Here is my mapping

  "mappings": {
    "properties": {
      "societe":     { "type": "keyword"    , "null_value" : "NA"},
      "adresse":     { "type": "keyword"    , "null_value" : "NA"},
      "email":       { "type": "keyword"    , "null_value" : "NA"},
      "tel":         { "type": "keyword"    , "null_value" : "NA"},
      "site":        { "type": "keyword"    , "null_value" : "NA"},
      "tags":        { "type": "text"    },
      "description": { "type": "text"      },
      "typesociete": { "type": "keyword"    , "null_value" : "NA"},
      "geoloc":      { "type": "geo_point" },
      "CP":          { "type": "keyword"    , "null_value" : "NA"},
      "num_dep":     { "type": "integer"   },
      "Occitanie":   { "type": "boolean"   }
    }
  }