# How to manually index mongodb without mongodb-river?

**URL:** <https://discuss.elastic.co/t/how-to-manually-index-mongodb-without-mongodb-river/11374>\
**Category:** Elasticsearch\
**Created:** [March 29, 2013, 9:56am UTC](https://discuss.elastic.co/t/how-to-manually-index-mongodb-without-mongodb-river/11374 "2013-03-29T09:56:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcxlcx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lcxlcx/32/2383_2.png) [@lcxlcx](https://discuss.elastic.co/u/lcxlcx)\
**Post date:** [March 29, 2013, 9:56am UTC](https://discuss.elastic.co/t/how-to-manually-index-mongodb-without-mongodb-river/11374/1 "2013-03-29T09:56:50Z")

</div>

For some reason, I want to index my mongodb manually, totally about 400 thousand docs.

I do this as follow:

1. use mongoexport to export all docs.
2. using POST api to index them one by one.

But I have some problems:

1. Every doc has a "\_id" field. If I index such a doc, I couldn't search it !  
I have to rename this filed to other name
2. The index process often chokes on some parsing errors, such as unecpeted  
character '(', invaild date format, etc. I have to fix it for every error.

Any idea?

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [March 29, 2013, 10:58am UTC](https://discuss.elastic.co/t/how-to-manually-index-mongodb-without-mongodb-river/11374/2 "2013-03-29T10:58:46Z")

</div>

Can you post a sample of offending document.

Thanks  
Vineeth

On Fri, Mar 29, 2013 at 3:26 PM, lcxlcx [nasa4836@gmail.com](mailto:nasa4836@gmail.com) wrote:

> For some reason, I want to index my mongodb manually, totally about 400  
> thousand docs.
> 
> I do this as follow:
> 
> 1. use mongoexport to export all docs.
> 2. using POST api to index them one by one.
> 
> But I have some problems:
> 
> 1. Every doc has a "\_id" field. If I index such a doc, I couldn't search it  
> !  
> I have to rename this filed to other name
> 2. The index process often chokes on some parsing errors, such as unecpeted  
> character '(', invaild date format, etc. I have to fix it for every  
> error.
> 
> Any idea?
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/How-to-manually-index-mongodb-without-mongodb-river-tp4032605.html](http://elasticsearch-users.115913.n3.nabble.com/How-to-manually-index-mongodb-without-mongodb-river-tp4032605.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> 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).

--  
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:** ![lcxlcx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lcxlcx/32/2383_2.png) [@lcxlcx](https://discuss.elastic.co/u/lcxlcx)\
**Post date:** [March 29, 2013, 11:30am UTC](https://discuss.elastic.co/t/how-to-manually-index-mongodb-without-mongodb-river/11374/3 "2013-03-29T11:30:37Z")

</div>

- For the invalid date format case:  
The error message is like this:  
" MapperParsingException[Failed to parse [birthday]]; nested:  
MapperParsingException[failed to parse date field [], tried both date format  
[dateOptionalTime], and timestamp number]; nested:  
IllegalArgumentException[Invalid format: ""]; ","status":400}"

- for the invalid "(" case, I fix it , I wrote a script to escape all these  
offending '(', but I dont konw how many other invalid character I will  
stumble upon 🙂

And my main question maybe : why this dirty problem won't occurs when using  
mongo-river plugin, but all burst out when I manually do it ??? So I came  
here to ask if I do anything wrong or any elegent method ?

--  
View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/How-to-manually-index-mongodb-without-mongodb-river-tp4032605p4032615.html](http://elasticsearch-users.115913.n3.nabble.com/How-to-manually-index-mongodb-without-mongodb-river-tp4032605p4032615.html)  
Sent from the ElasticSearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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:** ![lcxlcx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lcxlcx/32/2383_2.png) [@lcxlcx](https://discuss.elastic.co/u/lcxlcx)\
**Post date:** [March 29, 2013, 11:34am UTC](https://discuss.elastic.co/t/how-to-manually-index-mongodb-without-mongodb-river/11374/4 "2013-03-29T11:34:37Z")

</div>

On Fri, Mar 29, 2013 at 6:59 PM, vineeth mohan [via Elasticsearch  
Users] [ml-node+s115913n4032610h4@n3.nabble.com](mailto:ml-node+s115913n4032610h4@n3.nabble.com) wrote:

> Can you post a sample of offending document.
> 
> Thanks  
> Vineeth

- For the invalid date format case:  
The error message is like this:  
" MapperParsingException[Failed to parse [birthday]]; nested:  
MapperParsingException[failed to parse date field , tried both date  
format [dateOptionalTime], and timestamp number]; nested:  
IllegalArgumentException[Invalid format: ""]; ","status":400}"

- for the invalid "(" case, I fix it , I wrote a script to escape all  
these offending '(', but I dont konw how many other invalid character  
I will stumble upon 🙂

And my main question maybe : why this dirty problem won't occurs when  
using mongo-river plugin, but all burst out when I manually do it ???  
So I came here to ask if I do anything wrong or any elegent way to do  
this?

--

Regards,  
Zhan Jianyu

---

<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:43am UTC](https://discuss.elastic.co/t/how-to-manually-index-mongodb-without-mongodb-river/11374/5 "2017-07-06T02:43:40Z")

</div>


