# CouchDB river not working out of the box

**URL:** <https://discuss.elastic.co/t/couchdb-river-not-working-out-of-the-box/4184>\
**Category:** Elasticsearch\
**Created:** [April 3, 2011, 8:14am UTC](https://discuss.elastic.co/t/couchdb-river-not-working-out-of-the-box/4184 "2011-04-03T08:14:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinthenext](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martinthenext/32/3247_2.png) [@martinthenext](https://discuss.elastic.co/u/martinthenext)\
**Post date:** [April 3, 2011, 8:14am UTC](https://discuss.elastic.co/t/couchdb-river-not-working-out-of-the-box/4184/1 "2011-04-03T08:14:02Z")

</div>

I beg your pardon for such a newbie question, but elasticsearch  
website states getting search running should be easy, so I've decided  
to try and use it with CouchDB. Following website instuctions on every  
step, I've ran into a IndexMissingException. Here's a complete  
description of what I've done:

Check if couchdb works:

dufft@ubuntu:~$ curl -X GET [http://localhost:5984](http://localhost:5984)  
{"couchdb":"Welcome","version":"1.0.1"}

Check if elasticsearch works:

dufft@ubuntu:~$ curl -X GET [http://localhost:9200](http://localhost:9200)  
{  
[...]  
}

Create a CouchDB database (named my\_couch\_db) for indexing (or use an  
existing one)

curl -X PUT [http://localhost:5984/my\_couch\_db](http://localhost:5984/my_couch_db)  
{"ok":true}

Enable the couchdb-river plugin in ElasticSearch

dufft@ubuntu:~$ cd elasticsearch/  
dufft@ubuntu:~/elasticsearch$ ./bin/plugin -install river-couchdb  
-\> Installing river-couchdb Downloading plugin from  
[http://elasticsearch.googlecode.com/svn/plugins/river-couchdb/elasticsearch-river-couchdb-0.15.2.zip](http://elasticsearch.googlecode.com/svn/plugins/river-couchdb/elasticsearch-river-couchdb-0.15.2.zip)  
... DONE

Configure ElasticSearch to start indexing

dufft@ubuntu:~/elasticsearch$ cat configure-indexing.sh  
curl -XPUT '[http://localhost:9200/\_river/my\_es\_idx/\_meta](http://localhost:9200/_river/my_es_idx/_meta)' -d '{  
"type" : "couchdb",  
"couchdb" : {  
"host" : "localhost",  
"port" : 5984,  
"db" : "my\_couch\_db",  
"filter" : null  
}  
}'  
dufft@ubuntu:~/elasticsearch$ ./configure-indexing.sh  
{"ok":true,"\_index":"\_river","\_type":"my\_es\_idx","\_id":"\_meta","\_version":  
4}duff

That’s it. We are ready to go. You can query ElasticSearch for the  
couchdb data at [http://elasticsearch-host:9200/my\_couch\_db/my\_couch\_db](http://elasticsearch-host:9200/my_couch_db/my_couch_db).

Creating a new document in my\_couch\_db database:

dufft@ubuntu:~$ cat data.json  
{  
"user" : "dufft",  
"text" : "some data here"  
}  
dufft@ubuntu:~$ curl -X PUT [http://localhost:5984/my\_couch\_db/text1](http://localhost:5984/my_couch_db/text1) -d  
@data.json  
{"ok":true,"id":"text1","rev":"1-a894aaef73fb81c5d0a2d1eb1fbd7532"}  
dufft@ubuntu:~$ curl -X GET [http://localhost:5984/my\_couch\_db/text1](http://localhost:5984/my_couch_db/text1)  
{"\_id":"text1","\_rev":"1-  
a894aaef73fb81c5d0a2d1eb1fbd7532","user":"dufft","text":"some data  
here"}

Now querying using 'request body':

dufft@ubuntu:~$ cat sample-query-1  
{  
"query" : {  
"term" : { "user" : "dufft" }  
}  
}

dufft@ubuntu:~$ url -X GET [http://localhost:9200/my\_couch\_db/my\_couch\_db/\_search](http://localhost:9200/my_couch_db/my_couch_db/_search)  
-d @sample-query-1  
{"error":"[[my\_couch\_db] missing]","status":404}

As you can see, I've followed instructions on  
[http://www.elasticsearch.org/tutorials/2010/08/01/couchb-integration.html](http://www.elasticsearch.org/tutorials/2010/08/01/couchb-integration.html)  
and [http://www.elasticsearch.org/guide/reference/api/search/](http://www.elasticsearch.org/guide/reference/api/search/) for  
couchdb and search. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![IvanBrusic](https://avatars.discourse-cdn.com/v4/letter/i/ecae2f/32.png) [@IvanBrusic](https://discuss.elastic.co/u/IvanBrusic)\
**Post date:** [April 3, 2011, 5:24pm UTC](https://discuss.elastic.co/t/couchdb-river-not-working-out-of-the-box/4184/2 "2011-04-03T17:24:02Z")

</div>

You named your index "my\_es\_idx", but are querying on the  
"my\_couch\_db" index. The name is set either in the PUT request  
"[http://localhost:9200/\_river/my\_es\_idx/\_meta](http://localhost:9200/_river/my_es_idx/_meta)" or overriden in the  
"index" section of the JSON ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/)  
reference/river/couchdb.html)

Ivan

On Apr 3, 4:14 am, martinthenext [martin.davt...@gmail.com](mailto:martin.davt...@gmail.com) wrote:

> I beg your pardon for such a newbie question, but elasticsearch  
> website states getting search running should be easy, so I've decided  
> to try and use it with CouchDB. Following website instuctions on every  
> step, I've ran into a IndexMissingException. Here's a complete  
> description of what I've done:
> 
> Check if couchdb works:
> 
> dufft@ubuntu:~$ curl -X GEThttp://localhost:5984  
> {"couchdb":"Welcome","version":"1.0.1"}
> 
> Check if elasticsearch works:
> 
> dufft@ubuntu:~$ curl -X GEThttp://localhost:9200  
> {  
> [...]
> 
> }
> 
> Create a CouchDB database (named my\_couch\_db) for indexing (or use an  
> existing one)
> 
> curl -X PUThttp://localhost:5984/my\_couch\_db  
> {"ok":true}
> 
> Enable the couchdb-river plugin in Elasticsearch
> 
> dufft@ubuntu:~$ cd elasticsearch/  
> dufft@ubuntu:~/elasticsearch$ ./bin/plugin -install river-couchdb  
> -\> Installing river-couchdb Downloading plugin fromhttp://elasticsearch.googlecode.com/svn/plugins/river-couchdb/elastic...  
> ... DONE
> 
> Configure Elasticsearch to start indexing
> 
> dufft@ubuntu:~/elasticsearch$ cat configure-indexing.sh  
> curl -XPUT '[http://localhost:9200/\_river/my\_es\_idx/\_meta'-d](http://localhost:9200/_river/my_es_idx/_meta'-d) '{  
> "type" : "couchdb",  
> "couchdb" : {  
> "host" : "localhost",  
> "port" : 5984,  
> "db" : "my\_couch\_db",  
> "filter" : null  
> }}'
> 
> dufft@ubuntu:~/elasticsearch$ ./configure-indexing.sh  
> {"ok":true,"\_index":"\_river","\_type":"my\_es\_idx","\_id":"\_meta","\_version":  
> 4}duff
> 
> That’s it. We are ready to go. You can query Elasticsearch for the  
> couchdb data athttp://elasticsearch-host:9200/my\_couch\_db/my\_couch\_db.
> 
> Creating a new document in my\_couch\_db database:
> 
> dufft@ubuntu:~$ cat data.json  
> {  
> "user" : "dufft",  
> "text" : "some data here"}
> 
> dufft@ubuntu:~$ curl -X PUThttp://localhost:5984/my\_couch\_db/text1-d  
> @data.json  
> {"ok":true,"id":"text1","rev":"1-a894aaef73fb81c5d0a2d1eb1fbd7532"}  
> dufft@ubuntu:~$ curl -X GEThttp://localhost:5984/my\_couch\_db/text1  
> {"\_id":"text1","\_rev":"1-  
> a894aaef73fb81c5d0a2d1eb1fbd7532","user":"dufft","text":"some data  
> here"}
> 
> Now querying using 'request body':
> 
> dufft@ubuntu:~$ cat sample-query-1  
> {  
> "query" : {  
> "term" : { "user" : "dufft" }  
> }
> 
> }
> 
> dufft@ubuntu:~$ url -X GEThttp://localhost:9200/my\_couch\_db/my\_couch\_db/\_search  
> -d @sample-query-1  
> {"error":"[[my\_couch\_db] missing]","status":404}
> 
> As you can see, I've followed instructions onhttp://www.elasticsearch.org/tutorials/2010/08/01/couchb-integration....  
> andhttp://www.elasticsearch.org/guide/reference/api/search/for  
> couchdb and search. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![martinthenext](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martinthenext/32/3247_2.png) [@martinthenext](https://discuss.elastic.co/u/martinthenext)\
**Post date:** [April 4, 2011, 7:41pm UTC](https://discuss.elastic.co/t/couchdb-river-not-working-out-of-the-box/4184/3 "2011-04-04T19:41:00Z")

</div>

Thanks, Ivan!

I've tried to change \_meta settings, but search query still returns an  
error, now a different one.

dufft@ubuntu:~$ cat settings

{  
"type" : "couchdb",  
"couchdb" : {  
"host" : "localhost",  
"port" : 5984,  
"db" : "my\_couch\_db",  
"filter" : null  
},  
"index" : {  
"index" : "my\_couch\_db",  
"type" : "my\_couch\_db",  
"bulk\_size" : "100",  
"bulk\_timeout" : "10ms"  
}  
}

curl -X PUT [http://localhost:9200/\_river/my\_couch\_db/\_meta](http://localhost:9200/_river/my_couch_db/_meta) -d  
@settings

{"ok":true,"\_index":"\_river","\_type":"my\_couch\_db","\_id":"\_meta","\_version":  
1}

curl -X GET [http://localhost:9200/my\_couch\_db/my\_couch\_db/\_search](http://localhost:9200/my_couch_db/my_couch_db/_search) -d  
@sample-query-1

{"error":"SearchPhaseExecutionException[Failed to execute phase  
[query], total failure; shardFailures {[It7yw-F7QBWTPLEUn6TJzg]  
[my\_couch\_db][0]: QueryPhaseExecutionException[[my\_couch\_db][0]:  
query[user:dufft],from[0],size[10]: Query Failed [Failed to execute  
main query]]; nested: TypeMissingException[[my\_couch\_db]  
type[my\_couch\_db] missing]; }{[It7yw-F7QBWTPLEUn6TJzg][my\_couch\_db]  
[1]: QueryPhaseExecutionException[[my\_couch\_db][1]:  
query[user:dufft],from[0],size[10]: Query Failed [Failed to execute  
main query]]; nested: TypeMissingException[[my\_couch\_db]  
type[my\_couch\_db] missing]; }{[It7yw-F7QBWTPLEUn6TJzg][my\_couch\_db]  
[2]: QueryPhaseExecutionException[[my\_couch\_db][2]:  
query[user:dufft],from[0],size[10]: Query Failed [Failed to execute  
main query]]; nested: TypeMissingException[[my\_couch\_db]  
type[my\_couch\_db] missing]; }{[It7yw-F7QBWTPLEUn6TJzg][my\_couch\_db]  
[3]: QueryPhaseExecutionException[[my\_couch\_db][3]:  
query[user:dufft],from[0],size[10]: Query Failed [Failed to execute  
main query]]; nested: TypeMissingException[[my\_couch\_db]  
type[my\_couch\_db] missing]; }{[It7yw-F7QBWTPLEUn6TJzg][my\_couch\_db]  
[4]: QueryPhaseExecutionException[[my\_couch\_db][4]:  
query[user:dufft],from[0],size[10]: Query Failed [Failed to execute  
main query]]; nested: TypeMissingException[[my\_couch\_db]  
type[my\_couch\_db] missing]; }]","status":500}

What does this suppose to mean? Any suggestions?

On Apr 3, 9:24 pm, Ivan Brusic [ivan\_bru...@yahoo.com](mailto:ivan_bru...@yahoo.com) wrote:

> You named your index "my\_es\_idx", but are querying on the  
> "my\_couch\_db" index. The name is set either in the PUT request  
> "[http://localhost:9200/\_river/my\_es\_idx/\_meta](http://localhost:9200/_river/my_es_idx/_meta)" or overriden in the  
> "index" section of the JSON ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/)  
> reference/river/couchdb.html)
> 
> Ivan
> 
> On Apr 3, 4:14 am, martinthenext [martin.davt...@gmail.com](mailto:martin.davt...@gmail.com) wrote:
> 
> > I beg your pardon for such a newbie question, but elasticsearch  
> > website states getting search running should be easy, so I've decided  
> > to try and use it with CouchDB. Following website instuctions on every  
> > step, I've ran into a IndexMissingException. Here's a complete  
> > description of what I've done:
> 
> > Check if couchdb works:
> 
> > dufft@ubuntu:~$ curl -X GEThttp://localhost:5984  
> > {"couchdb":"Welcome","version":"1.0.1"}
> 
> > Check if elasticsearch works:
> 
> > dufft@ubuntu:~$ curl -X GEThttp://localhost:9200  
> > {  
> > [...]
> 
> > }
> 
> > Create a CouchDB database (named my\_couch\_db) for indexing (or use an  
> > existing one)
> 
> > curl -X PUThttp://localhost:5984/my\_couch\_db  
> > {"ok":true}
> 
> > Enable the couchdb-river plugin in Elasticsearch
> 
> > dufft@ubuntu:~$ cd elasticsearch/  
> > dufft@ubuntu:~/elasticsearch$ ./bin/plugin -install river-couchdb  
> > -\> Installing river-couchdb Downloading plugin fromhttp://elasticsearch.googlecode.com/svn/plugins/river-couchdb/elastic...  
> > ... DONE
> 
> > Configure Elasticsearch to start indexing
> 
> > dufft@ubuntu:~/elasticsearch$ cat configure-indexing.sh  
> > curl -XPUT '[http://localhost:9200/\_river/my\_es\_idx/\_meta'-d'](http://localhost:9200/_river/my_es_idx/_meta'-d'){  
> > "type" : "couchdb",  
> > "couchdb" : {  
> > "host" : "localhost",  
> > "port" : 5984,  
> > "db" : "my\_couch\_db",  
> > "filter" : null  
> > }}'
> 
> > dufft@ubuntu:~/elasticsearch$ ./configure-indexing.sh  
> > {"ok":true,"\_index":"\_river","\_type":"my\_es\_idx","\_id":"\_meta","\_version":  
> > 4}duff
> 
> > That’s it. We are ready to go. You can query Elasticsearch for the  
> > couchdb data athttp://elasticsearch-host:9200/my\_couch\_db/my\_couch\_db.
> 
> > Creating a new document in my\_couch\_db database:
> 
> > dufft@ubuntu:~$ cat data.json  
> > {  
> > "user" : "dufft",  
> > "text" : "some data here"}
> 
> > dufft@ubuntu:~$ curl -X PUThttp://localhost:5984/my\_couch\_db/text1-d  
> > @data.json  
> > {"ok":true,"id":"text1","rev":"1-a894aaef73fb81c5d0a2d1eb1fbd7532"}  
> > dufft@ubuntu:~$ curl -X GEThttp://localhost:5984/my\_couch\_db/text1  
> > {"\_id":"text1","\_rev":"1-  
> > a894aaef73fb81c5d0a2d1eb1fbd7532","user":"dufft","text":"some data  
> > here"}
> 
> > Now querying using 'request body':
> 
> > dufft@ubuntu:~$ cat sample-query-1  
> > {  
> > "query" : {  
> > "term" : { "user" : "dufft" }  
> > }
> 
> > }
> 
> > dufft@ubuntu:~$ url -X GEThttp://localhost:9200/my\_couch\_db/my\_couch\_db/\_search  
> > -d @sample-query-1  
> > {"error":"[[my\_couch\_db] missing]","status":404}
> 
> > As you can see, I've followed instructions onhttp://www.elasticsearch.org/tutorials/2010/08/01/couchb-integration....  
> > andhttp://www.elasticsearch.org/guide/reference/api/search/for  
> > couchdb and search. What am I doing wrong?

---

<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:08am UTC](https://discuss.elastic.co/t/couchdb-river-not-working-out-of-the-box/4184/4 "2017-07-06T04:08:54Z")

</div>


