Exporting Data From MongoDB to Elastic Search


(Gaurav) #1

Hi All,

I am importing my MongoDB data on elasticsearch by using elaster plugin
written in node.js. My defined mapping not working for nested type data.
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 }

Please check attached index.js file which describes configuration for
elaster as well as mapping defined. When I execute elaster plugin to export
data 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?]' }

Note - Value for "i" could be [] (blank array) for some documents but in
generate it would have structure like explained above.

Any help or suggestion would be greatly appreciated.

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5f7c382b-03cb-44ca-99fa-7f0bf85c6846%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2