Mapper parsing exception - unsupported parameter

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"}
}
}
}

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"
        }
      }
    }
  }
}

do i have to assign a type?

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

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