Specify a child mapping for attribute with variable name


#1

I have a document such as the following and I want to map the child fields “name” and “displayValue” in the full text index. I’ve created a child mapping for “tags”, but how to handle the next level, as the property name is unknown?

{
   "tags": {
       "125J": {
           "displayValue": "food",
           "name": "tag_food"
       },
      "1s7Y": {
           "displayValue": "New Years Day",
           "name": "tag_nyd"
      }
   }
   "content": "content for a document that mentions food"
}

#2

I have the same question. It works if “dynamic” is set for “tags”, but then everything is indexed, not possible to limit to some fields. In this example, how would it be possible to index only “name”, but not “displayValue” to keep the index as small as possible?

And a similar question, if I have a JSON like this:

    {"tags": [
     {"type" : "foo",
       "title": "this is a title we want in the index"
     },
     {"type: "bar",
       "title": "this title we don't want to index"
     }
  ]
}

Is it possible to index only the elements in type “foo”, but not in type “bar”?