Mapper parsing exception - unsupported parameter


(Sahar Q) #1

Hi guys, i've attempted to add this template and for some reason it says there are unsupported parameters, i failed to detect the error on my end and would like you to take a look :
{
"template": "arp-table",
"settings": {
"number_of_shards": 1
},
"mappings": {
"properties": {
"Host" : {"type": "ip"},
"Interface" : {"type": "ip"},
"Internet Address" : {"type": "ip"},
"Physical Address" : {"type": "keyword"},
"Type" : {"type": "keyword"}
}
}
}


(Colin Goodheart-Smithe) #2

you need to put your document type between the mappings and properties objects. So a correct template would look like this:

PUT _template/foo
{
  "template": "arp-table",
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {
    "my_type": {
      "properties": {
        "Host": {
          "type": "ip"
        },
        "Interface": {
          "type": "ip"
        },
        "Internet Address": {
          "type": "ip"
        },
        "Physical Address": {
          "type": "keyword"
        },
        "Type": {
          "type": "keyword"
        }
      }
    }
  }
}

(Sahar Q) #3

do i have to assign a type?


(Colin Goodheart-Smithe) #4

yes, you also need to assign a type to documents when you index them. See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html


(system) #5

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