Dynamic mapping templates: can it match on nesting depth?


(Eelco Hillenius) #1

Hi!

I'm using nested properties as a way to scope indexing data for different audiences. For example:

{
  "internal": {
    "author": "Mikey Mike",
    "status": "RETIRED"
  },
  "extcorp": {
    "name": "cool stuff",
    "subject": "LANG"
  }

}

should have a (partial) mapping of:

{
  "mappings": {
    "_doc": {
      "properties": {
        "internal": {
          "type": "nested" 
        },
        "extcorp": {
          "type": "nested" 
        }
      }
    }
  }
}

The properties nested further would be part of the nested docs, and hence not denoted as nested.

I know that these nested props are always on the first level of nesting. Is there a way to write a dynamic mapping template that matches this first level (only) and instructs ES to index these as nested props?

Thanks!

Eelco


(Eelco Hillenius) #2

bump?