client.indices.putMapping({
"index": "test",
"type": "persons",
"body": {
"mappings": {
"properties": {
"mname": {
"type": "string",
"store": true
}
}
}
}
}, callback)
我收到此错误:
MapperParsingException[Root type mapping not empty after parsing! Remaining fields:
[
mappings : {
properties={
mname= {
type=string,
store=true
}
}
}
]
]
Error: MapperParsingException[Root type mapping not empty after parsing! Remaining fields:
[
mappings : {
properties={
mname= {
type=string,
store=true
}
}
}
]
]
at respond (/home/rajit/IdeaProjects/Applane/node_modules/elasticsearch/src/lib/transport.js:234:15)
at checkRespForFailure (/home/rajit/IdeaProjects/Applane/node_modules/elasticsearch/src/lib/transport.js:202:7)
at HttpConnector.<anonymous> (/home/rajit/IdeaProjects/Applane/node_modules/elasticsearch/src/lib/connectors/http.js:148:7)
at IncomingMessage.bound (/home/rajit/IdeaProjects/Applane/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13)
节点模块elasticsearch版本是2.4.2 elasticsearch服务器是1.3.2
答案 0 :(得分:1)
抛出Elasticsearch的MapperParsingException意味着JSON中总是存在错误。
因此,当它发生时,您应首先检查您的JSON是否有效。