# MongoDB River Plugin 1.1.0

**URL:** <https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878>\
**Category:** Elasticsearch\
**Created:** [March 4, 2012, 11:51am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878 "2012-03-04T11:51:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Louapre](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Richard\_Louapre](https://discuss.elastic.co/u/Richard_Louapre)\
**Post date:** [March 4, 2012, 11:51am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/1 "2012-03-04T11:51:41Z")

</div>

Hi,

MongoDB River Plugin 1.1.0 has just been released [0].  
MongoDB River will now work with the new Elasticsearch 0.19.0.

To install it use:  
plugin.bat -install elasticsearch/elasticsearch-mapper-attachments/1.2.0  
plugin.bat -install richardwilly98/elasticsearch-river-mongodb/1.1.0

[0] - [https://github.com/richardwilly98/elasticsearch-river-mongodb](https://github.com/richardwilly98/elasticsearch-river-mongodb)

Ciao,  
Richard.

---

<div class="post-metadata">

**Author:** ![d95sld95\_2](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@d95sld95\_2](https://discuss.elastic.co/u/d95sld95_2)\
**Post date:** [March 8, 2012, 3:45pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/2 "2012-03-08T15:45:04Z")

</div>

I am not sure what I am doing wrong. I can't get the river to replicate  
from Mongo to ElasticSearch.

Here is what I am doing.

In Mongo:

Database: _cm_  
Collection: _screens_

1. Installed Mongo 2.0.3 and ElasticSearch 0.19.0.
2. Install ElasticSearch plugins

plugin.bat -install elasticsearch/elasticsearch-mapper-attachments/1.2.0

plugin.bat -install richardwilly98/elasticsearch-river-mongodb/1.1.0

1. Changed mongo and elastic search logging to debug at root level
2. Started ElasticSearch (./elasticsearch)
3. Started mongo (./mongod -replSet funWithOplogs)
4. In mongo console I execute 'rs.initiate()'
5. Using curl I add the river

curl -PUT [http://localhost:9200/\_river/mongo/\_meta](http://localhost:9200/_river/mongo/_meta) -d

'{

type: "mongodb",

mongodb : {db: "cm", collection: "screens"},

index: {name: "mongoindex", type: "screens"}

}'

1. I insert data into the mongo database 'cm' and collection 'screens'
2. Verify that the data is in mongo
3. Query ElasticSearch

curl -XGET localhost:9200/cm/screens/\_search?pretty

1. I get nothing from elasticsearch other than 0 hits

{  
"took" : 1,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 0,  
"max\_score" : null,  
"hits" : []  
}

I am not sure if I am querying the wrong index in elasticsearch or if I am  
configuring the river correctly. Also is Mongo running with oplog on all  
the time or do I need to start it with -replSet?

---

<div class="post-metadata">

**Author:** ![d95sld95\_2](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@d95sld95\_2](https://discuss.elastic.co/u/d95sld95_2)\
**Post date:** [March 8, 2012, 9:10pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/3 "2012-03-08T21:10:31Z")

</div>

A little additional information from elastic search:

From log file

[2012-03-08 16:00:34,007][DEBUG][cluster.action.shard] [Songbird]  
sending shard started for [amazon][2], node[XO-XIlcrSrCagCvYR4QUOw], [R],  
s[INITIALIZING], reason [after recovery (replica) from node [[Ghost  
Girl][4lwZnx8QR\_euxyP8UtWIkQ][inet[/192.168.10.84:9300]]]]  
[2012-03-08 16:00:34,010][DEBUG][index.shard.service] [Songbird]  
[\_river][0] state: [RECOVERING]-\>[STARTED], reason [post recovery]  
[2012-03-08 16:00:34,010][DEBUG][index.shard.service] [Songbird]  
[\_river][0] scheduling refresher every 1s  
[2012-03-08 16:00:34,010][DEBUG][index.shard.service] [Songbird]  
[\_river][0] scheduling optimizer / merger every 1s  
[2012-03-08 16:00:34,013][DEBUG][indices.recovery] [Songbird]  
[\_river][0] recovery completed from [Ghost  
Girl][4lwZnx8QR\_euxyP8UtWIkQ][inet[/192.168.10.84:9300]], took[214ms]  
phase1: recovered\_files [1] with total\_size of [1.5kb], took [10ms],  
throttling\_wait [0s]  
: reusing\_files [16] with total\_size of [1kb]  
phase2: start took [92ms]  
: recovered [2] transaction log operations, took [93ms]  
phase3: recovered [0] transaction log operations, took [16ms]  
[2012-03-08 16:00:34,014][DEBUG][cluster.action.shard] [Songbird]  
sending shard started for [\_river][0], node[XO-XIlcrSrCagCvYR4QUOw], [R],  
s[INITIALIZING], reason [after recovery (replica) from node [[Ghost  
Girl][4lwZnx8QR\_euxyP8UtWIkQ][inet[/192.168.10.84:9300]]]]  
[2012-03-08 16:00:34,014][DEBUG][cluster.service] [Songbird]  
processing [zen-disco-receive(from master [[Ghost  
Girl][4lwZnx8QR\_euxyP8UtWIkQ][inet[/192.168.10.84:9300]]])]: done applying  
updated cluster\_state  
[2012-03-08 16:00:34,014][DEBUG][cluster.service] [Songbird]  
processing [zen-disco-receive(from master [[Ghost  
Girl][4lwZnx8QR\_euxyP8UtWIkQ][inet[/192.168.10.84:9300]]])]: execute  
[2012-03-08 16:00:34,014][DEBUG][cluster.service] [Songbird]  
cluster state updated, version [276], source [zen-disco-receive(from master  
[[Ghost Girl][4lwZnx8QR\_euxyP8UtWIkQ][inet[/192.168.10.84:9300]]])]  
[2012-03-08 16:00:34,015][DEBUG][cluster.action.shard] [Songbird]  
sending shard started for [\_river][0], node[XO-XIlcrSrCagCvYR4QUOw], [R],  
s[INITIALIZING], reason [master [Ghost  
Girl][4lwZnx8QR\_euxyP8UtWIkQ][inet[/192.168.10.84:9300]] marked shard as  
initializing, but shard already started, mark shard as started]

Inside look at river configuration

curl -GET localhost:9200/\_river/mongo/\_search?pretty

{  
"took" : 2,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 1,  
"successful" : 1,  
"failed" : 0  
},  
"hits" : {  
"total" : 2,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "\_river",  
"\_type" : "mongo",  
"\_id" : "\_meta",  
"\_score" : 1.0, "\_source" : {type: "mongodb", mongodb : {db: "cm",  
collection: "screens"}, index: {name: "mongoindex", type: "screens"}}  
}, {  
"\_index" : "\_river",  
"\_type" : "mongo",  
"\_id" : "\_status",  
"\_score" : 1.0, "\_source" :  
{"ok":true,"node":{"id":"4lwZnx8QR\_euxyP8UtWIkQ","name":"Ghost  
Girl","transport\_address":"inet[/192.168.10.84:9300]"}}  
} ]  
}

---

<div class="post-metadata">

**Author:** ![Serikozz](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Serikozz](https://discuss.elastic.co/u/Serikozz)\
**Post date:** [May 22, 2012, 6:27am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/4 "2012-05-22T06:27:29Z")

</div>

I am running exactly as you did  
curl -XPUT '[http://localhost:9200/\_river/test/\_meta](http://localhost:9200/_river/test/_meta)' -d '{  
"type": "mongodb",  
"mongodb": {  
"db": "test",  
"collection": "es\_test"  
},  
"index": {  
"name": "mongoindex",  
"type": "es\_test"  
}  
}'  
However I am getting the following exception again and again:

{"error":"MapperParsingException[Failed to parse]; nested:  
JsonParseException[Un  
expected character ('m' (code 109)): expected a valid value (number,  
String, array, object, 'true', 'false' or 'null')\n at [Source:  
[B@61f133ea; line: 1, column:8]]; ","status":400}

can you please point out what I am doing wrong? I am completely new to  
ElasticSearch and will appreciate your assistance.

---

<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:** [May 22, 2012, 5:01pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/5 "2012-05-22T17:01:20Z")

</div>

What does your mongodb docs looks like ?

Le 22 mai 2012 à 08:27, Serikozz [serikozz@mail.ru](mailto:serikozz@mail.ru) a écrit :

> I am running exactly as you did  
> curl -XPUT '[http://localhost:9200/\_river/test/\_meta](http://localhost:9200/_river/test/_meta)' -d '{  
> "type": "mongodb",  
> "mongodb": {  
> "db": "test",  
> "collection": "es\_test"  
> },  
> "index": {  
> "name": "mongoindex",  
> "type": "es\_test"  
> }  
> }'  
> However I am getting the following exception again and again:
> 
> {"error":"MapperParsingException[Failed to parse]; nested:  
> JsonParseException[Un  
> expected character ('m' (code 109)): expected a valid value (number,  
> String, array, object, 'true', 'false' or 'null')\n at [Source:  
> [B@61f133ea; line: 1, column:8]]; ","status":400}
> 
> can you please point out what I am doing wrong? I am completely new to  
> Elasticsearch and will appreciate your assistance.
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/MongoDB-River-Plugin-1-1-0-tp3797903p4006086.html](http://elasticsearch-users.115913.n3.nabble.com/MongoDB-River-Plugin-1-1-0-tp3797903p4006086.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Serikozz](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Serikozz](https://discuss.elastic.co/u/Serikozz)\
**Post date:** [May 23, 2012, 5:58am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/6 "2012-05-23T05:58:05Z")

</div>

it is a tweets that I've collected

{ "_id" : ObjectId("4fbb380cfed8f515a0000005"), "created\_at" : "Tue May 22 06:54  
:05 +0000 2012", "in\_reply\_to\_user\_id" : null, "place" : null, "in\_reply\_to\_scre  
en\_name" : null, "favorited" : false, "source" : "\<a href="http://www.echofon.c  
om/" rel="nofollow"\>Echofon", "truncated" : false, "in\_reply\_to\_status\_id  
" : null, "entities" : { "urls" : [], "hashtags" : [], "user\_mentions" : [] }  
, "id\_str" : "204827455935086592", "retweet\_count" : 0, "contributors" : null, "  
geo" : null, "in\_reply\_to\_user\_id\_str" : null, "user" : { "profile\_background\_im  
age\_url" : "[http://a0.twimg.com/images/themes/theme1/bg.png](http://a0.twimg.com/images/themes/theme1/bg.png)", "profile\_text\_colo  
r" : "333333", "show\_all\_inline\_media" : false, "notifications" : null, "contrib  
utors\_enabled" : false, "profile\_background\_tile" : false, "created\_at" : "Mon A  
ug 08 19:19:02 +0000 2011", "time\_zone" : "Central Time (US & Canada)", "listed_  
count" : 4, "profile\_image\_url" : "[http://a0.twimg.com/profile\_images/2239532534](http://a0.twimg.com/profile_images/2239532534)  
/madamGABalot\_normal.jpg", "follow\_request\_sent" : null, "is\_translator" : false  
, "url" : null, "friends\_count" : 530, "utc\_offset" : -21600, "verified" : false  
, "screen\_name" : "madamGABalot", "profile\_background\_color" : "C0DEED", "lang"  
: "en", "id\_str" : "351080465", "statuses\_count" : 26720, "default\_profile\_image  
" : false, "description" : "Life is the only thing one should take advantage of  
FOLLOW my instagram GABsnapsALOT\n", "favourites\_count" : 58, "profile\_use\_backg  
round\_image" : true, "default\_profile" : true, "profile\_sidebar\_border\_color" :  
"C0DEED", "following" : null, "profile\_sidebar\_fill\_color" : "DDEEF6", "geo\_enab  
led" : false, "id" : 351080465, "profile\_link\_color" : "0084B4", "followers\_coun  
t" : 770, "profile\_background\_image\_url\_https" : "[https://si0.twimg.com/images/t](https://si0.twimg.com/images/t)  
hemes/theme1/bg.png", "location" : "On Top of Myself", "name" : "Ssshhh", "prote  
cted" : false, "profile\_image\_url\_https" : "[https://si0.twimg.com/profile\_images](https://si0.twimg.com/profile_images)  
/2239532534/madamGABalot\_normal.jpg" }, "retweeted" : false, "id" : NumberLong("  
204827455935086592"), "in\_reply\_to\_status\_id\_str" : null, "coordinates" : null,  
"text" : "In a happy place right now but the best part is its only gonna get bet  
ter" }

But I only need to retrieve from MongoDB tweets's text:

{ "\_id" : ObjectId("4fbb380cfed8f515a0000004"), "text" : "Lil Wayne Singlee Oh Y  
opp #SiyahTweetin笶､笶､笶､" }  
{ "\_id" : ObjectId("4fbb380cfed8f515a0000005"), "text" : "In a happy place right  
now but the best part is its only gonna get better" }

---

<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:** [May 23, 2012, 6:48am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/7 "2012-05-23T06:48:30Z")

</div>

I think the problem is here : "\_id" : ObjectId("4fbb380cfed8f515a0000005")

IMHO, ObjectId("4fbb380cfed8f515a0000005") could not be an ID for an ES document.

I don't know how the mongodb river works (does it extract id from ObjectId ?), but the error log seems to indicate that the error comes from this.

HTH  
David

Le 23 mai 2012 à 07:58, Serikozz [serikozz@mail.ru](mailto:serikozz@mail.ru) a écrit :

> "\_id" : ObjectId("4fbb380cfed8f515a0000005")

---

<div class="post-metadata">

**Author:** ![Serikozz](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Serikozz](https://discuss.elastic.co/u/Serikozz)\
**Post date:** [May 23, 2012, 7:32am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/8 "2012-05-23T07:32:14Z")

</div>

I'm running it with command promt  
I've tried with single line and even tried to execute an example from [https://github.com/richardwilly98/elasticsearch-river-mongodb](https://github.com/richardwilly98/elasticsearch-river-mongodb) with double quote coz Windows seems don't like single quote

curl -XPUT "[http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)" -d "{"type":"mongodb", "mongodb":{"db":"testmongo", "collection":"person"}, "index":{"name":"mongoindex", "type":"person"} }"

however still getting this error:

{"error":"MapperParsingException[Failed to parse]; nested: JsonParseException[Un  
expected character ('m' (code 109)): expected a valid value (number, String, arr  
ay, object, 'true', 'false' or 'null')\n at [Source: [B@5fa13de; line: 1, colum n: 8]]; ","status":400}

What this error actually means?

---

<div class="post-metadata">

**Author:** ![medcl\_net](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@medcl\_net](https://discuss.elastic.co/u/medcl_net)\
**Post date:** [May 23, 2012, 10:54am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/9 "2012-05-23T10:54:15Z")

</div>

Hi,

A pinyin analysis plugin integrates Pinyin4j([http://pinyin4j.sourceforge.net/](http://pinyin4j.sourceforge.net/)) has just rocks up,it can used to convert chinese characters to pinyin.

To install it use:  
plugin -install medcl/elasticsearch-analysis-pinyin/1.1.0

And here is the project url:

> **[medcl/elasticsearch-analysis-pinyin](https://github.com/medcl/elasticsearch-analysis-pinyin)**
>
> elasticsearch-analysis-pinyin - This Pinyin Analysis plugin is used to do conversion between Chinese characters and Pinyin.

Have fun~

Medcl

---

<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:27am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-1-1-0/6878/10 "2017-07-06T03:27:33Z")

</div>


