# Elasticsearch client with couchdb support for creating index

**URL:** <https://discuss.elastic.co/t/elasticsearch-client-with-couchdb-support-for-creating-index/27682>\
**Category:** Elasticsearch\
**Created:** [August 19, 2015, 2:38pm UTC](https://discuss.elastic.co/t/elasticsearch-client-with-couchdb-support-for-creating-index/27682 "2015-08-19T14:38:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imad](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@imad](https://discuss.elastic.co/u/imad)\
**Post date:** [August 19, 2015, 2:38pm UTC](https://discuss.elastic.co/t/elasticsearch-client-with-couchdb-support-for-creating-index/27682/1 "2015-08-19T14:38:24Z")

</div>

Does elasticsearch client ([https://github.com/elastic/elasticsearch-js](https://github.com/elastic/elasticsearch-js)) for javascript, support creating indices for couchdb. With curl we can setcouchdb type when creating index as follows:

curl -XPUT "[http://localhost:9200/\_river/user\_idx/\_meta](http://localhost:9200/_river/user_idx/_meta)" -d "{  
"type": "couchdb",  
"couchdb": {  
"host": "localhost",  
"port": 5984,  
"db": "users",  
"filter": null  
},  
"index": {  
"index": "user\_idx",  
"type": "users",  
"bulk\_size": "100",  
"bulk\_timeout": "10ms"  
}  
}"  
I am using elasticsearch river for couch and with above code of creating index, data is filled by river seamlessly and I can get all data.

I tired this :  
esClient.indices.create({index: "users\_index",  
body: {  
"type" : "couchdb",  
"couchdb" : {  
"host" : "localhost",  
"port" :"5984",  
"db" :"users"  
},  
"index" : {  
"index" : "users\_index",  
"type" : "users",  
"bulk\_size" : "100",  
"bulk\_timeout" : "10ms"  
}  
}}).then(function(x){  
console.log(x);  
callback(null);  
},  
function(err){  
console.log(err);  
callback(null);  
});

When I search for data like this in sense (GET users\_index/users\_index/\_search), I get this without any data:

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

With .indices.create or .index, I could not find any option to set couchdb for index. Will appreciate any  
help.

---

<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 5, 2017, 11:54pm UTC](https://discuss.elastic.co/t/elasticsearch-client-with-couchdb-support-for-creating-index/27682/2 "2017-07-05T23:54:58Z")

</div>


