Dynamic Templates MapperParsingException


(Galim Kaudinov) #1

I am trying to create a mapping with dynamic template inside, I am doing this through sense plugin. And I am getting this exception

{
   "error": "MapperParsingException[Root type mapping not empty after parsing! Remaining fields:   [dyanmic_templates : [{textField={match=txt_*, mapping={type=string, index_analyzer=ngram_index, search_analyzer=standard, fields={sort={type=string, index_analyzer=sortable}}}}}]]]",
   "status": 400
}

Here is my request:

POST cf_index/cftype/_mapping
{
  "cftype" : {
    "dyanmic_templates": [
        {"textField": {
          "match": "txt_*",
          "mapping": {
            "type": "string",
            "index_analyzer": "ngram_index",
            "search_analyzer": "standard",
            "fields": {
               "sort": {
                  "type": "string",
                  "index_analyzer": "sortable"
               }
            }
          }
          
          
        }
          
      }
    ],
    "properties": {
      "name" : { "type": "string" }
    }
  }
}

I don't really understand what the exception is telling me here. Any suggestions?


(Galim Kaudinov) #2

I got it. It was the spelling error.

dyanmic_templates -> dynamic_templates


(system) #3