I am trying to return a mongodb document from elasticsearch. The document is being returned but the arrays are always empty e.g.
curl -XGET 'http://localhost:9200/smartjn/feed_details/_search?q=_id:577905710baf751293410bed&pretty=true'
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "smartjn",
"_type" : "feed_details",
"_id" : "577905710baf751293410bed",
"_score" : 1.0,
"_source" : {
"rejectionId" : "",
"image" : [ ],
"subward" : "56a6124244fc868a255fe3fe",
"longi" : "72.8179",
"subDepartment" : "Environment",
"vote" : 0,
"workFlowType" : "Event",
"wardname" : "Dhokali",
"title" : "Test Feed for MassUpload :925",
"approvalStatus" : "approved",
"adminFlag" : "1",
"userID" : "superadmin",
"uniquerefno" : "ED3488",
"department" : "Social Causes",
"upVoteUserIds" : [ ],
"feedStatusDescription" : "03-07-2016 18:00:41",
"description" : "Test Feed Description for MassUpload :925",
"sorter" : "2016-07-03T18:00:40.812000",
"downVoteUserIds" : [ ],
"muteFeedUserIds" : [ ],
"lat" : "18.35367",
"dateCreated" : "03-07-2016 18:00:41",
"muteUserIds" : [ ],
"followFeedUserIds" : [ ],
"feedStatus" : "New",
"externalRefNo" : "",
"anonymousFlag" : "0",
"downVote" : 0
}
} ]
}
}
Same document in mongodb returns all fields correct:
rs0:PRIMARY> db.feed_details.find({_id : ObjectId("577905710baf751293410bed")}).pretty()
{
"_id" : ObjectId("577905710baf751293410bed"),
"department" : "Social Causes",
"subDepartment" : "Environment",
"workFlowType" : "Event",
"lat" : "18.35367",
"longi" : "72.8179",
"title" : "Test Feed for MassUpload :925",
"description" : "Test Feed Description for MassUpload :925",
"image" : [ ],
"userID" : "superadmin",
"anonymousFlag" : "0",
"approvalStatus" : "approved",
"dateCreated" : "03-07-2016 18:00:41",
"feedStatus" : "New",
"vote" : 1,
"downVote" : 0,
"rejectionId" : "",
"feedStatusDescription" : "03-07-2016 18:00:41",
"followFeedUserIds" : [
"5734236844fc869a32793b7f"
],
"muteFeedUserIds" : [
"5734236844fc869a32793b7f"
],
"muteUserIds" : [ ],
"externalRefNo" : "",
"subward" : "56a6124244fc868a255fe3fe",
"upVoteUserIds" : [
"5734236844fc869a32793b7f"
],
"downVoteUserIds" : [ ],
"uniquerefno" : "ED3488",
"adminFlag" : "1",
"sorter" : ISODate("2016-07-03T18:00:40.812Z"),
"wardname" : "Dhokali"
}
Any idea what am I missing?
Thanks