Null value in field type with nested

I have a filed , that if has value , it has ID and TITLE .
so , wold be like this -


category: { id: 2, title: 'monitor' }

but can be like this as well

category: NULL

So I did like this the mapping -

  "category":{
             "properties": {
              "id": { "type": "integer" },
              "title": { "type": "keyword" }
            },
             "null_value": "NULL" 
         },

but it seams that I can set null_value there -

    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Mapping definition for [type] has unsupported parameters:  [null_value : NULL]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Failed to parse mapping: Mapping definition for [type] has unsupported parameters:  [null_value : NULL]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "Mapping definition for [type] has unsupported parameters:  [null_value : NULL]"
    }
  },

What wold be the best way to do it ?

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