Validation Failed: 1: mapping source is empty;


(Steven) #1

Hello,

I just want to create a new and simple index/mapping (I follow the docs) in ES 5.0, but I am always getting "Validation Failed: 1: mapping source is empty;" What am I doing wrong ?
These are the commands :

$ curl -XPUT 'srpiso02d:9210/twitter?pretty' -d'
{
"mappings": {
"tweet": {
"properties": {
"message": {
"type": "text"
}
}
}
}
}
'

{
"mappings": {
"tweet": {
"properties": {
"message": {
"type": "text"
}
}
}
}
}
'
{
"acknowledged" : true,
** "shards_acknowledged" : true**
}
$ curl -XGET "http://srpiso02d:9210/twitter/_mapping"
{"twitter":{"mappings":{}}}srpiso02d:/var/hpsrp/srpiso02d/elastic/ES$

--> mapping is empty

$ curl -XPUT 'srpiso02d:9210/twitter/_mapping/user?pretty' -d'
{
"properties": {
"name": {
"type": "text"
}
}
}

{'
"properties": {
"name": {
"type": "text"
}
}
}
'
{
"error" : {
"root_cause" : [
{
"type" : "action_request_validation_exception",
** "reason" : "Validation Failed: 1: mapping source is empty;"**
}
],
"type" : "action_request_validation_exception",
** "reason" : "Validation Failed: 1: mapping source is empty;"**
},
"status" : 400
}

Many thanks in advance.


(Steven) #2

More clear :

curl -XPUT 'srpiso02d:9210/twitter?pretty' -H 'Content-Type: application/json' -d'
{
"mappings": {
"tweet": {
"properties": {
"message": {
"type": "text"
}
}
}
}
}
'
curl -XPUT 'srpiso02d:9210/twitter/_mapping/user?pretty' -H 'Content-Type: application/json' -d'
{
"properties": {
"name": {
"type": "text"
}
}
}
'
{
** "error" : {**
** "root_cause" : [**
** {**
** "type" : "action_request_validation_exception",**
** "reason" : "Validation Failed: 1: mapping source is empty;"**
** }**
** ],**
** "type" : "action_request_validation_exception",**
** "reason" : "Validation Failed: 1: mapping source is empty;"**
** },**
** "status" : 400**
}


(system) #3

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