# ES with Mongodb

**URL:** <https://discuss.elastic.co/t/es-with-mongodb/3605>\
**Category:** Elasticsearch\
**Created:** [November 28, 2010, 11:02am UTC](https://discuss.elastic.co/t/es-with-mongodb/3605 "2010-11-28T11:02:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gautam](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@Gautam](https://discuss.elastic.co/u/Gautam)\
**Post date:** [November 28, 2010, 11:02am UTC](https://discuss.elastic.co/t/es-with-mongodb/3605/1 "2010-11-28T11:02:24Z")

</div>

Hi,

Has anyone integrated ES with mongodb. I would really appreciate if  
you share your experience and how you have done it.

I am exploring options to use ES for full text search for some of my  
data stored in Mongo.  
Is there any easy way to update ES indexes as and when mongodb gets  
updated? Just so that I can avoid duplicating the data.

Thanks  
Gautam

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 28, 2010, 11:06pm UTC](https://discuss.elastic.co/t/es-with-mongodb/3605/2 "2010-11-28T23:06:39Z")

</div>

Hi,

There were some questions about it some time ago, maybe people who have  
done it can jump in. The way that I see it, you will need to integrate the  
sync between the two on the client side. For example, everytime you change  
something on mongo, apply the same change to ES (either directly or through  
a message queue).

I don't see a way that ES can do it automatically by querying mongo (as  
it does with couchdb and the \_changes stream). But, if someone has an idea,  
I would be happy to hear it and maybe we can implement it.

-shay.banon

On Sun, Nov 28, 2010 at 1:02 PM, Gautam [mrgautamsam@gmail.com](mailto:mrgautamsam@gmail.com) wrote:

> Hi,
> 
> Has anyone integrated ES with mongodb. I would really appreciate if  
> you share your experience and how you have done it.
> 
> I am exploring options to use ES for full text search for some of my  
> data stored in Mongo.  
> Is there any easy way to update ES indexes as and when mongodb gets  
> updated? Just so that I can avoid duplicating the data.
> 
> Thanks  
> Gautam

---

<div class="post-metadata">

**Author:** ![Gautam](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@Gautam](https://discuss.elastic.co/u/Gautam)\
**Post date:** [November 29, 2010, 8:02am UTC](https://discuss.elastic.co/t/es-with-mongodb/3605/3 "2010-11-29T08:02:08Z")

</div>

Thanks Shay for your response. Much appreciated.  
Yup, that is a way to do it.  
But was looking for a much more seamless integration.

It would have been great if I could have specified something like (using a  
push mechanism):

1. Watch Collection A and B
2. Index a selected set of attributes and subdocuments of a particular  
Collection.

And that's it.  
Then onwards any change in these collections ES gets notified and the job is  
done.

All these can be done in a wrapper layer as well, but would have ideal  
through a mongo push.

Thanks  
Gautam

On Mon, Nov 29, 2010 at 4:36 AM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Hi,
> 
> There were some questions about it some time ago, maybe people who have  
> done it can jump in. The way that I see it, you will need to integrate the  
> sync between the two on the client side. For example, everytime you change  
> something on mongo, apply the same change to ES (either directly or through  
> a message queue).
> 
> I don't see a way that ES can do it automatically by querying mongo (as  
> it does with couchdb and the \_changes stream). But, if someone has an idea,  
> I would be happy to hear it and maybe we can implement it.
> 
> -shay.banon
> 
> On Sun, Nov 28, 2010 at 1:02 PM, Gautam [mrgautamsam@gmail.com](mailto:mrgautamsam@gmail.com) wrote:
> 
> > Hi,
> > 
> > Has anyone integrated ES with mongodb. I would really appreciate if  
> > you share your experience and how you have done it.
> > 
> > I am exploring options to use ES for full text search for some of my  
> > data stored in Mongo.  
> > Is there any easy way to update ES indexes as and when mongodb gets  
> > updated? Just so that I can avoid duplicating the data.
> > 
> > Thanks  
> > Gautam

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 29, 2010, 10:06am UTC](https://discuss.elastic.co/t/es-with-mongodb/3605/4 "2010-11-29T10:06:29Z")

</div>

Agreed, though I am not familiar with a mongo push feature, do they have it?

On Mon, Nov 29, 2010 at 10:02 AM, Gautam Mr [mrgautamsam@gmail.com](mailto:mrgautamsam@gmail.com) wrote:

> Thanks Shay for your response. Much appreciated.  
> Yup, that is a way to do it.  
> But was looking for a much more seamless integration.
> 
> It would have been great if I could have specified something like (using a  
> push mechanism):
> 
> 1. Watch Collection A and B
> 2. Index a selected set of attributes and subdocuments of a particular  
> Collection.
> 
> And that's it.  
> Then onwards any change in these collections ES gets notified and the job  
> is done.
> 
> All these can be done in a wrapper layer as well, but would have ideal  
> through a mongo push.
> 
> Thanks  
> Gautam
> 
> On Mon, Nov 29, 2010 at 4:36 AM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > Hi,
> > 
> > There were some questions about it some time ago, maybe people who have  
> > done it can jump in. The way that I see it, you will need to integrate the  
> > sync between the two on the client side. For example, everytime you change  
> > something on mongo, apply the same change to ES (either directly or through  
> > a message queue).
> > 
> > I don't see a way that ES can do it automatically by querying mongo (as  
> > it does with couchdb and the \_changes stream). But, if someone has an idea,  
> > I would be happy to hear it and maybe we can implement it.
> > 
> > -shay.banon
> > 
> > On Sun, Nov 28, 2010 at 1:02 PM, Gautam [mrgautamsam@gmail.com](mailto:mrgautamsam@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > Has anyone integrated ES with mongodb. I would really appreciate if  
> > > you share your experience and how you have done it.
> > > 
> > > I am exploring options to use ES for full text search for some of my  
> > > data stored in Mongo.  
> > > Is there any easy way to update ES indexes as and when mongodb gets  
> > > updated? Just so that I can avoid duplicating the data.
> > > 
> > > Thanks  
> > > Gautam

---

<div class="post-metadata">

**Author:** ![Gautam](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@Gautam](https://discuss.elastic.co/u/Gautam)\
**Post date:** [November 29, 2010, 10:46am UTC](https://discuss.elastic.co/t/es-with-mongodb/3605/5 "2010-11-29T10:46:43Z")

</div>

Have sent a query to Mongo team, will let you know when I hear back.

On Mon, Nov 29, 2010 at 3:36 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Agreed, though I am not familiar with a mongo push feature, do they have  
> it?
> 
> On Mon, Nov 29, 2010 at 10:02 AM, Gautam Mr [mrgautamsam@gmail.com](mailto:mrgautamsam@gmail.com) wrote:
> 
> > Thanks Shay for your response. Much appreciated.  
> > Yup, that is a way to do it.  
> > But was looking for a much more seamless integration.
> > 
> > It would have been great if I could have specified something like (using a  
> > push mechanism):
> > 
> > 1. Watch Collection A and B
> > 2. Index a selected set of attributes and subdocuments of a particular  
> > Collection.
> > 
> > And that's it.  
> > Then onwards any change in these collections ES gets notified and the job  
> > is done.
> > 
> > All these can be done in a wrapper layer as well, but would have ideal  
> > through a mongo push.
> > 
> > Thanks  
> > Gautam
> > 
> > On Mon, Nov 29, 2010 at 4:36 AM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > Hi,
> > > 
> > > There were some questions about it some time ago, maybe people who have  
> > > done it can jump in. The way that I see it, you will need to integrate the  
> > > sync between the two on the client side. For example, everytime you change  
> > > something on mongo, apply the same change to ES (either directly or through  
> > > a message queue).
> > > 
> > > I don't see a way that ES can do it automatically by querying mongo  
> > > (as it does with couchdb and the \_changes stream). But, if someone has an  
> > > idea, I would be happy to hear it and maybe we can implement it.
> > > 
> > > -shay.banon
> > > 
> > > On Sun, Nov 28, 2010 at 1:02 PM, Gautam [mrgautamsam@gmail.com](mailto:mrgautamsam@gmail.com) wrote:
> > > 
> > > > Hi,
> > > > 
> > > > Has anyone integrated ES with mongodb. I would really appreciate if  
> > > > you share your experience and how you have done it.
> > > > 
> > > > I am exploring options to use ES for full text search for some of my  
> > > > data stored in Mongo.  
> > > > Is there any easy way to update ES indexes as and when mongodb gets  
> > > > updated? Just so that I can avoid duplicating the data.
> > > > 
> > > > Thanks  
> > > > Gautam

---

<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, 4:16am UTC](https://discuss.elastic.co/t/es-with-mongodb/3605/6 "2017-07-06T04:16:02Z")

</div>


