I want to export data from MongoDB to ElasticSearch.Mongo River plugin is an option for me to first take dump of collection and then restore which works fine for me.But I do not want to use Mongo River plugin , I am using elaster to export data from MongoDB to Elasticsearch.
- Elastic Search Version - 1.3.2
- Node.js version - v0.11.8-pre
- MongoDB Version - 2.4.x
When I execute : ./bin/elaster it says:
{
[Error: MapperParsingException[object mapping for [collection] tried to parse as object, but got EOF, has a concrete value been provided to it?]]
message: 'MapperParsingException[object mapping for [collection] tried to parse as object, but got EOF, has a concrete value been provided to it?]'
}
My Elaster Configuration is:
module.exports = {
mongo: {
connection: 'mongodb://127.0.0.1:27017/times'
},
elastic: {
host: {
host: '127.0.0.1'
},
requestTimeout: 5000
},
collections: [
{
name: "walldisplay",
index: "walldisplay",
type: "collection",
fields: [
"_id",
"wat",
"wct",
"u",
"i",
"cd"
],
mappings: {
"collection": {
"properties": {
"wat":{
'type':'string',
'index': 'not_analyzed'
},
"wct":{
'type':'string',
'index': 'not_analyzed'
},
"u":{
"type" : "object",
"dynamic" : true,
"properties":{
"_id":{
'type':'string',
'index': 'not_analyzed'
},
"n":{
'type':'string',
'index': 'not_analyzed'
},
"st":{
'type':'string',
'index': 'not_analyzed'
},
"id":{
'type':'string',
'index': 'not_analyzed'
}
},
"index":"not_analyzed"
},
"i":{
"type" : "nested",
"include_in_parent" : true,
"properties":{
"_id":{
'type':'string',
'index': 'not_analyzed'
},
"ti":{
'type':'string',
'index': 'not_analyzed'
},
"st":{
'type':'string',
'index': 'not_analyzed'
},
"n":{
'type':'string',
'index': 'not_analyzed'
},
"cst":{
'type':'string',
'index': 'not_analyzed'
}
}
},
"cd":{
'type':'long',
'index': 'not_analyzed'
},
}
}
}
}
]
};
Also please check sample document in-line
{
"_id": ObjectId("5406a47970b17246b9a293e1"),
"cd": 1409721465,
"i": [
{
"_id": ObjectId("50f693d17deed44cf000007f"),
"st": "seo-title",
"ti": "title",
"n": "categoryname",
"cst": "category-seotitle",
"r": null,
"c": null
},
{
"_id": ObjectId("50f693d17deed44cf000007f"),
"st": "seo-title",
"ti": "title",
"n": "categoryname",
"cst": "category-seotitle",
"r": null,
"c": null
},
{
"_id": ObjectId("50f693d17deed44cf000007f"),
"st": "seo-title",
"ti": "title",
"n": "categoryname",
"cst": "category-seotitle",
"r": null,
"c": null
}
],
"u": {
"_id": ObjectId("50ce4f79edaffd69e40ee010"),
"n": "Richa Sen",
"st": "richasen",
"id": "d8mzxlp9ekn323l6jg5s8tly1"
},
"wat": 1,
"wct": 1
}