Using the elasticsearch-mongodb-river to index multiple collections in the same db

Hello,

I am not sure if this is the right forum for the mongodb river by
Richard Willy (https://github.com/richardwilly98/elasticsearch-river-
mongodb/). I have used it successfully for indexing a single
collection. However, I can't figure out how to index multiple
collections from mongodb.

This works for a single collection:
curl -XPUT 'http://192.168.25.1:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"host" : "192.168.25.1",
"port" : "20020",
"db": "staging",
"collection": "discussions"
},
"index": {
"name": "discussions_idx",
"type": "discussion"
}
}'

When I add another collection for indexing using the following
command:
curl -XPUT 'http://192.168.25.1:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"host" : "192.168.25.1",
"port" : "20020",
"db": "staging",
"collection": "users"
},
"index": {
"name": "users_idx",
"type": "user"
}
}'

Nothing happens and the index is not created. I am using the latest
version of the river from github on ES 0.19.0

Thanks,

-moizd

Any solution for this? Seems odd that a river can only watch a single
collection.

Corey

On Wednesday, March 14, 2012 12:37:34 PM UTC-5, MoizD wrote:

Hello,

I am not sure if this is the right forum for the mongodb river by
Richard Willy (https://github.com/richardwilly98/elasticsearch-river-
mongodb/ https://github.com/richardwilly98/elasticsearch-river-mongodb/).
I have used it successfully for indexing a single
collection. However, I can't figure out how to index multiple
collections from mongodb.

This works for a single collection:
curl -XPUT 'http://192.168.25.1:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"host" : "192.168.25.1",
"port" : "20020",
"db": "staging",
"collection": "discussions"
},
"index": {
"name": "discussions_idx",
"type": "discussion"
}
}'

When I add another collection for indexing using the following
command:
curl -XPUT 'http://192.168.25.1:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"host" : "192.168.25.1",
"port" : "20020",
"db": "staging",
"collection": "users"
},
"index": {
"name": "users_idx",
"type": "user"
}
}'

Nothing happens and the index is not created. I am using the latest
version of the river from github on ES 0.19.0

Thanks,

-moizd

--

The rivers must have different names. See how the URL is different than
your example. Also, in the example below, notice that the index:name can
be the same between the two - just use different types.

From: https://github.com/richardwilly98/elasticsearch-river-mongodb/issues/32

curl -XPUT 'http://192.168.25.1:9200/_river/discussion/_meta' -d '{
"type": "mongodb",
"mongodb": {
"host" : "192.168.25.1",
"port" : "20020",
"db": "staging",
"collection": "discussions"
},
"index": {
"name": "my_apps_index",
"type": "discussion"
}
}'

When I add another collection for indexing using the following
command:
curl -XPUT 'http://192.168.25.1:9200/_river/user/_meta' -d '{
"type": "mongodb",
"mongodb": {
"host" : "192.168.25.1",
"port" : "20020",
"db": "staging",
"collection": "users"
},
"index": {
"name": "my_apps_index",
"type": "user"
}
}'

On Wednesday, March 14, 2012 12:37:34 PM UTC-5, MoizD wrote:

Hello,

I am not sure if this is the right forum for the mongodb river by
Richard Willy (https://github.com/richardwilly98/elasticsearch-river-
mongodb/ https://github.com/richardwilly98/elasticsearch-river-mongodb/).
I have used it successfully for indexing a single
collection. However, I can't figure out how to index multiple
collections from mongodb.

This works for a single collection:
curl -XPUT 'http://192.168.25.1:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"host" : "192.168.25.1",
"port" : "20020",
"db": "staging",
"collection": "discussions"
},
"index": {
"name": "discussions_idx",
"type": "discussion"
}
}'

When I add another collection for indexing using the following
command:
curl -XPUT 'http://192.168.25.1:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"host" : "192.168.25.1",
"port" : "20020",
"db": "staging",
"collection": "users"
},
"index": {
"name": "users_idx",
"type": "user"
}
}'

Nothing happens and the index is not created. I am using the latest
version of the river from github on ES 0.19.0

Thanks,

-moizd

--