# Reindexing data mongodb-es

**URL:** <https://discuss.elastic.co/t/reindexing-data-mongodb-es/9177>\
**Category:** Elasticsearch\
**Created:** [September 27, 2012, 9:24pm UTC](https://discuss.elastic.co/t/reindexing-data-mongodb-es/9177 "2012-09-27T21:24:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coys](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@coys](https://discuss.elastic.co/u/coys)\
**Post date:** [September 27, 2012, 9:24pm UTC](https://discuss.elastic.co/t/reindexing-data-mongodb-es/9177/1 "2012-09-27T21:24:21Z")

</div>

Hello, sorry if I've asked a silly question but I can't figure out the  
solution.  
I have data stored in mongodb and the collections are mapped to es  
indices using richardwilly's plugin. However, a couple of my indices  
are messed up (due to which not all the data that I expect to see is  
in es (its still in mongodb)). I tried creating a dummy index on dummy  
data and I expect that after re-indexing I will now see this data in  
es.

The problem seems to be that the mongo river operates on the oplog and  
after I delete the index, after inserting the next first new document  
I want to see the other thousands of documents in mongodb to  
automatically now be visible in es. However, I only see the documents  
that I inserted after deleting and recreating the indexes. The other  
1000's of documents are still visible in mongo but not in es.

I did a small experiment and I saw that if I actually reinserted the  
500 documents, they are then visible in elasticsearch(if the index is  
right to allow them all in). Can you please tell me how I can make the  
data in mongodb visible in es after I recreate the index without  
having to delete and reinsert as I cannot do this. Do I need to replay  
the oplog or is there another approach that you can suggest such that  
I can get this data into es without deleting and reinserting?

Thanks!

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 28, 2012, 12:32am UTC](https://discuss.elastic.co/t/reindexing-data-mongodb-es/9177/2 "2012-09-28T00:32:41Z")

</div>

Did you try to remove and create again the river itself?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 27 sept. 2012 à 23:24, coys [gautam719@gmail.com](mailto:gautam719@gmail.com) a écrit :

Hello, sorry if I've asked a silly question but I can't figure out the  
solution.  
I have data stored in mongodb and the collections are mapped to es  
indices using richardwilly's plugin. However, a couple of my indices  
are messed up (due to which not all the data that I expect to see is  
in es (its still in mongodb)). I tried creating a dummy index on dummy  
data and I expect that after re-indexing I will now see this data in  
es.

The problem seems to be that the mongo river operates on the oplog and  
after I delete the index, after inserting the next first new document  
I want to see the other thousands of documents in mongodb to  
automatically now be visible in es. However, I only see the documents  
that I inserted after deleting and recreating the indexes. The other  
1000's of documents are still visible in mongo but not in es.

I did a small experiment and I saw that if I actually reinserted the  
500 documents, they are then visible in elasticsearch(if the index is  
right to allow them all in). Can you please tell me how I can make the  
data in mongodb visible in es after I recreate the index without  
having to delete and reinsert as I cannot do this. Do I need to replay  
the oplog or is there another approach that you can suggest such that  
I can get this data into es without deleting and reinserting?

Thanks!

--

--

---

<div class="post-metadata">

**Author:** ![coys](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@coys](https://discuss.elastic.co/u/coys)\
**Post date:** [September 28, 2012, 4:43am UTC](https://discuss.elastic.co/t/reindexing-data-mongodb-es/9177/3 "2012-09-28T04:43:33Z")

</div>

Thanks a lot David! That worked 🙂

> Hello, sorry if I've asked a silly question but I can't figure out the  
> solution.  
> I have data stored in mongodb and the collections are mapped to es  
> indices using richardwilly's plugin. However, a couple of my indices  
> are messed up (due to which not all the data that I expect to see is  
> in es (its still in mongodb)). I tried creating a dummy index on dummy  
> data and I expect that after re-indexing I will now see this data in  
> es.
> 
> The problem seems to be that the mongo river operates on the oplog and  
> after I delete the index, after inserting the next first new document  
> I want to see the other thousands of documents in mongodb to  
> automatically now be visible in es. However, I only see the documents  
> that I inserted after deleting and recreating the indexes. The other  
> 1000's of documents are still visible in mongo but not in es.
> 
> I did a small experiment and I saw that if I actually reinserted the  
> 500 documents, they are then visible in elasticsearch(if the index is  
> right to allow them all in). Can you please tell me how I can make the  
> data in mongodb visible in es after I recreate the index without  
> having to delete and reinsert as I cannot do this. Do I need to replay  
> the oplog or is there another approach that you can suggest such that  
> I can get this data into es without deleting and reinserting?
> 
> Thanks!
> 
> --

--

---

<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, 3:11am UTC](https://discuss.elastic.co/t/reindexing-data-mongodb-es/9177/4 "2017-07-06T03:11:01Z")

</div>


