# Elasticsearch mongodb river with GridFS attached to DBObject problem

**URL:** <https://discuss.elastic.co/t/elasticsearch-mongodb-river-with-gridfs-attached-to-dbobject-problem/14456>\
**Category:** Elasticsearch\
**Created:** [November 19, 2013, 1:12am UTC](https://discuss.elastic.co/t/elasticsearch-mongodb-river-with-gridfs-attached-to-dbobject-problem/14456 "2013-11-19T01:12:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoran\_Jeremic](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@Zoran\_Jeremic](https://discuss.elastic.co/u/Zoran_Jeremic)\
**Post date:** [November 19, 2013, 1:12am UTC](https://discuss.elastic.co/t/elasticsearch-mongodb-river-with-gridfs-attached-to-dbobject-problem/14456/1 "2013-11-19T01:12:41Z")

</div>

Hi,

I'm using Elasticsearch mongodb river to index documents stored in mongodb,  
but  
I couln't find appropriate documentation clearly explaining how to solve  
the  
problem I have. Document has a form of DBObject containing several custom  
fields and GridFSInputFile attached as "file" field.  
I specified a river like:  
PUT \_meta  
{  
"type": "mongodb",  
"mongodb": {  
"db": "platform4",  
"collection": "documents2"  
},  
"index": {  
"name": "inextweb\_documents4",  
"type": "documents"  
}  
}

MongoDB and GridFS store document and file properly. Elasticsearch river  
also  
maps document so it can be searched over the custom fields. However, I'm  
not  
able to search text within files.  
I tried to add "gridfs":"true" and "gridfs":"fs.files" when I specified  
river,  
but that combination didn't work at all.I didn't use mappings at  
initialization  
as I don't know which fields could be added at runtime.  
Could you please suggest what could be the problem here?  
This is the document format:

{  
"engine\_id": "engineid1234",  
"external\_id": "[http://en.wikipedia.org/wiki/Healthcare\_in\_India](http://en.wikipedia.org/wiki/Healthcare_in_India)",  
"contentType": "text/html",  
"added": 1384822341,  
"file": {  
"\_id": {  
"$oid": "528ab645975c8c01cdb201fb"  
},  
"chunkSize": 262144,  
"length": 171063,  
"md5": "59cb83ecde3378749c58893567e021a3",  
"filename": "9fd7cce6-4248-41f3-98f0-dffb498a061d",  
"contentType": null,  
"uploadDate": {  
"$date": "2013-11-19T00:52:21.009Z"  
},  
"aliases": null  
},  
"fields": [  
{  
"title": {  
"boost": 2.21,  
"type": "text",  
"value": "Healthcare in India"  
}  
},  
{  
"domain": {  
"boost": 0,  
"type": "text",  
"value": "wikipedia.org"  
}  
}  
]  
}

Thanks,  
Zoran

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:06am UTC](https://discuss.elastic.co/t/elasticsearch-mongodb-river-with-gridfs-attached-to-dbobject-problem/14456/2 "2017-07-06T02:06:21Z")

</div>

Closed on July 6, 2017, 2:06am UTC


