Dynamic Mapping keyword over text without path_match

Is there a way to force a field to be a 'keyword' type as opposed to a 'text' type without relying on the field name and path_matching ?

I don't know which field names I'll be indexing, but I'd like to be able to submit some type information along with these to specify either keyword or text.

I could manipulate my fieldname to use a path_match in a dynamic template, eg.

 "dynamic_templates": [
    {
  "keywords": {
    "path_match": "*_k_",
    "mapping": {
      "type": "keyword"
    }
  }
}

....

would correctly identify a field named: myfield_k_ as a keyword field. but then I'd want the field to be stored as 'myfield' without the k appendage.

I don't think index time renaming is possible, but I thought I'd check.

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