# How to stop couchdb river to use default dynamic mapping

**URL:** <https://discuss.elastic.co/t/how-to-stop-couchdb-river-to-use-default-dynamic-mapping/9550>\
**Category:** Elasticsearch\
**Created:** [November 4, 2012, 6:50pm UTC](https://discuss.elastic.co/t/how-to-stop-couchdb-river-to-use-default-dynamic-mapping/9550 "2012-11-04T18:50:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amit_singh/32/2654_2.png) [@Amit\_Singh](https://discuss.elastic.co/u/Amit_Singh)\
**Post date:** [November 4, 2012, 6:50pm UTC](https://discuss.elastic.co/t/how-to-stop-couchdb-river-to-use-default-dynamic-mapping/9550/1 "2012-11-04T18:50:42Z")

</div>

How to disable Couchdb river dynamic mapping? I have my own custom mapping  
and I create this mapping at time of index creation. When I integrate  
couchdb with ES, my custom mappings get overridden by river's default  
dynamic mapping. Not sure why this is happening.

--

---

<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:** [November 4, 2012, 9:21pm UTC](https://discuss.elastic.co/t/how-to-stop-couchdb-river-to-use-default-dynamic-mapping/9550/2 "2012-11-04T21:21:40Z")

</div>

Hi Amit,

Can you elaborate a bit more what is your concern?

If you have created first your index and type with its mapping (with all  
fields that CouchDB will send), ES will not have to update it.

Can you gist your commands and what you are seeing?

David

De : [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)]  
De la part de Amit Singh  
Envoyé : dimanche 4 novembre 2012 19:51  
À : [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Objet : How to stop couchdb river to use default dynamic mapping

How to disable Couchdb river dynamic mapping? I have my own custom mapping  
and I create this mapping at time of index creation. When I integrate  
couchdb with ES, my custom mappings get overridden by river's default  
dynamic mapping. Not sure why this is happening.

--

--

---

<div class="post-metadata">

**Author:** ![Amit\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amit_singh/32/2654_2.png) [@Amit\_Singh](https://discuss.elastic.co/u/Amit_Singh)\
**Post date:** [November 5, 2012, 11:23am UTC](https://discuss.elastic.co/t/how-to-stop-couchdb-river-to-use-default-dynamic-mapping/9550/3 "2012-11-05T11:23:33Z")

</div>

Hi David,

This is how I am creating index and mapping. I just want to index firstName  
field of document. Though, there are other fields as well in doc.

curl -XPUT "[http://localhost:9200/lockpoc/](http://localhost:9200/lockpoc/)" -d '{  
"settings": {  
"number\_of\_shards": 5,  
"number\_of\_replicas": 1,  
"mappings": {  
"profiles": {  
"properties": {  
"firstName": {  
"type": "string"  
}  
}  
}  
}  
}'

This is the command for connecting to CouchDB using river api. After  
executing river command, mapping gets changed and overriden by default  
dynamic mapping by CouchDB river.

curl -XPUT 'localhost:9200/\_river/profiles\_db/\_meta' -d '{  
"type" : "couchdb",  
"couchdb" : {  
"host" : "localhost",  
"port" : 5984,  
"db" : "registry",  
"filter" : null,  
"user" : "amit",  
"password" : "amit",  
"ignore\_attachments":true  
},  
"index" : {  
"index" : "lockpoc",  
"type" : "profiles",  
"bulk\_size" : "100",  
"bulk\_timeout" : "10ms"  
}  
}'

This is output of \_river/mapping. I am not sure why dynamic is true here.

curl -XGET '[http://localhost:9200/\_river/\_mapping?pretty=1](http://localhost:9200/_river/_mapping?pretty=1)'  
{  
"\_river" : {  
"profiles\_db" : {  
"properties" : {  
"couchdb" : {  
"dynamic" : "true",  
"properties" : {  
"db" : {  
"type" : "string"  
},  
"host" : {  
"type" : "string"  
},  
"ignore\_attachments" : {  
"type" : "boolean"  
},  
"last\_seq" : {  
"type" : "string"  
},  
"password" : {  
"type" : "string"  
},  
"port" : {  
"type" : "long"  
},  
"user" : {  
"type" : "string"  
}  
}  
},  
"index" : {  
"dynamic" : "true",  
"properties" : {  
"bulk\_size" : {  
"type" : "string"  
},  
"bulk\_timeout" : {  
"type" : "string"  
},  
"index" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
},  
"node" : {  
"dynamic" : "true",  
"properties" : {  
"id" : {  
"type" : "string"  
},  
"name" : {  
"type" : "string"  
},  
"transport\_address" : {  
"type" : "string"  
}  
}  
},  
"ok" : {  
"type" : "boolean"  
},  
"type" : {  
"type" : "string"  
}  
}  
}  
}  
}

Regards,  
Amit

On Mon, Nov 5, 2012 at 2:51 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Hi Amit,\*\*\*\*
> 
> * * *
> 
> Can you elaborate a bit more what is your concern?\*\*\*\*
> 
> If you have created first your index and type with its mapping (with all  
> fields that CouchDB will send), ES will not have to update it.\*\*\*\*
> 
> * * *
> 
> Can you gist your commands and what you are seeing?\*\*\*\*
> 
> * * *
> 
> David\*\*\*\*
> 
> * * *
> 
> * * *
> 
> _De :_ [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [mailto:  
> [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] _De la part de_ Amit Singh  
> _Envoyé :_ dimanche 4 novembre 2012 19:51  
> _À :_ [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> _Objet :_ How to stop couchdb river to use default dynamic mapping\*\*\*\*
> 
> * * *
> 
> How to disable Couchdb river dynamic mapping? I have my own custom mapping  
> and I create this mapping at time of index creation. When I integrate  
> couchdb with ES, my custom mappings get overridden by river's default  
> dynamic mapping. Not sure why this is happening.\*\*\*\*
> 
> --
> 
> * * *
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [November 5, 2012, 10:39pm UTC](https://discuss.elastic.co/t/how-to-stop-couchdb-river-to-use-default-dynamic-mapping/9550/4 "2012-11-05T22:39:01Z")

</div>

It has been awhile since I worked with rivers (and never with CouchDB), so  
hopefully my memory is correct.

First of all, sounds like you want to disable dynamic mapping on your  
index. More details can be found at

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Second, IIRC, you are outputting the mapping of the river index, not the  
mapping of the index populated by the river. Sounds confusing, but rivers  
are stored in an index which can be queried like any other index. Try using  
instead

curl -XGET '[http://localhost:9200/lockpoc/\_mapping?pretty=1](http://localhost:9200/lockpoc/_mapping?pretty=1)[http://localhost:9200/\_river/\_mapping?pretty=1](http://localhost:9200/_river/_mapping?pretty=1)  
'

Cheers,

Ivan

On Mon, Nov 5, 2012 at 3:23 AM, Amit Singh [amit.archie@gmail.com](mailto:amit.archie@gmail.com) wrote:

> Hi David,
> 
> This is how I am creating index and mapping. I just want to index  
> firstName field of document. Though, there are other fields as well in doc.
> 
> curl -XPUT "[http://localhost:9200/lockpoc/](http://localhost:9200/lockpoc/)" -d '{  
> "settings": {  
> "number\_of\_shards": 5,  
> "number\_of\_replicas": 1,  
> "mappings": {  
> "profiles": {  
> "properties": {  
> "firstName": {  
> "type": "string"  
> }  
> }  
> }  
> }  
> }'
> 
> This is the command for connecting to CouchDB using river api. After  
> executing river command, mapping gets changed and overriden by default  
> dynamic mapping by CouchDB river.
> 
> curl -XPUT 'localhost:9200/\_river/profiles\_db/\_meta' -d '{  
> "type" : "couchdb",  
> "couchdb" : {  
> "host" : "localhost",  
> "port" : 5984,  
> "db" : "registry",  
> "filter" : null,  
> "user" : "amit",  
> "password" : "amit",  
> "ignore\_attachments":true  
> },  
> "index" : {  
> "index" : "lockpoc",  
> "type" : "profiles",  
> "bulk\_size" : "100",  
> "bulk\_timeout" : "10ms"  
> }  
> }'
> 
> This is output of \_river/mapping. I am not sure why dynamic is true here.
> 
> curl -XGET '[http://localhost:9200/\_river/\_mapping?pretty=1](http://localhost:9200/_river/_mapping?pretty=1)'  
> {  
> "\_river" : {  
> "profiles\_db" : {  
> "properties" : {  
> "couchdb" : {  
> "dynamic" : "true",  
> "properties" : {  
> "db" : {  
> "type" : "string"  
> },  
> "host" : {  
> "type" : "string"  
> },  
> "ignore\_attachments" : {  
> "type" : "boolean"  
> },  
> "last\_seq" : {  
> "type" : "string"  
> },  
> "password" : {  
> "type" : "string"  
> },  
> "port" : {  
> "type" : "long"  
> },  
> "user" : {  
> "type" : "string"  
> }  
> }  
> },  
> "index" : {  
> "dynamic" : "true",  
> "properties" : {  
> "bulk\_size" : {  
> "type" : "string"  
> },  
> "bulk\_timeout" : {  
> "type" : "string"  
> },  
> "index" : {  
> "type" : "string"  
> },  
> "type" : {  
> "type" : "string"  
> }  
> }  
> },  
> "node" : {  
> "dynamic" : "true",  
> "properties" : {  
> "id" : {  
> "type" : "string"  
> },  
> "name" : {  
> "type" : "string"  
> },  
> "transport\_address" : {  
> "type" : "string"  
> }  
> }  
> },  
> "ok" : {  
> "type" : "boolean"  
> },  
> "type" : {  
> "type" : "string"  
> }  
> }  
> }  
> }  
> }
> 
> Regards,  
> Amit
> 
> On Mon, Nov 5, 2012 at 2:51 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > Hi Amit,\*\*\*\*
> > 
> > * * *
> > 
> > Can you elaborate a bit more what is your concern?\*\*\*\*
> > 
> > If you have created first your index and type with its mapping (with all  
> > fields that CouchDB will send), ES will not have to update it.\*\*\*\*
> > 
> > * * *
> > 
> > Can you gist your commands and what you are seeing?\*\*\*\*
> > 
> > * * *
> > 
> > David\*\*\*\*
> > 
> > * * *
> > 
> > * * *
> > 
> > _De :_ [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [mailto:  
> > [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] _De la part de_ Amit Singh  
> > _Envoyé :_ dimanche 4 novembre 2012 19:51  
> > _À :_ [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> > _Objet :_ How to stop couchdb river to use default dynamic mapping\*\*\*\*
> > 
> > * * *
> > 
> > How to disable Couchdb river dynamic mapping? I have my own custom  
> > mapping and I create this mapping at time of index creation. When I  
> > integrate couchdb with ES, my custom mappings get overridden by river's  
> > default dynamic mapping. Not sure why this is happening.\*\*\*\*
> > 
> > --
> > 
> > * * *
> > 
> > --
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Amit\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amit_singh/32/2654_2.png) [@Amit\_Singh](https://discuss.elastic.co/u/Amit_Singh)\
**Post date:** [November 6, 2012, 3:04am UTC](https://discuss.elastic.co/t/how-to-stop-couchdb-river-to-use-default-dynamic-mapping/9550/5 "2012-11-06T03:04:31Z")

</div>

Thanks Ivan, I am able to solve this dynamic mapping problem.

On Tue, Nov 6, 2012 at 4:09 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> It has been awhile since I worked with rivers (and never with CouchDB), so  
> hopefully my memory is correct.
> 
> First of all, sounds like you want to disable dynamic mapping on your  
> index. More details can be found at  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/dynamic-mapping.html)
> 
> Second, IIRC, you are outputting the mapping of the river index, not the  
> mapping of the index populated by the river. Sounds confusing, but rivers  
> are stored in an index which can be queried like any other index. Try using  
> instead
> 
> curl -XGET '[http://localhost:9200/lockpoc/\_mapping?pretty=1](http://localhost:9200/lockpoc/_mapping?pretty=1)[http://localhost:9200/\_river/\_mapping?pretty=1](http://localhost:9200/_river/_mapping?pretty=1)  
> '
> 
> Cheers,
> 
> Ivan
> 
> On Mon, Nov 5, 2012 at 3:23 AM, Amit Singh [amit.archie@gmail.com](mailto:amit.archie@gmail.com) wrote:
> 
> > Hi David,
> > 
> > This is how I am creating index and mapping. I just want to index  
> > firstName field of document. Though, there are other fields as well in doc.
> > 
> > curl -XPUT "[http://localhost:9200/lockpoc/](http://localhost:9200/lockpoc/)" -d '{  
> > "settings": {  
> > "number\_of\_shards": 5,  
> > "number\_of\_replicas": 1,  
> > "mappings": {  
> > "profiles": {  
> > "properties": {  
> > "firstName": {  
> > "type": "string"  
> > }  
> > }  
> > }  
> > }  
> > }'
> > 
> > This is the command for connecting to CouchDB using river api. After  
> > executing river command, mapping gets changed and overriden by default  
> > dynamic mapping by CouchDB river.
> > 
> > curl -XPUT 'localhost:9200/\_river/profiles\_db/\_meta' -d '{  
> > "type" : "couchdb",  
> > "couchdb" : {  
> > "host" : "localhost",  
> > "port" : 5984,  
> > "db" : "registry",  
> > "filter" : null,  
> > "user" : "amit",  
> > "password" : "amit",  
> > "ignore\_attachments":true  
> > },  
> > "index" : {  
> > "index" : "lockpoc",  
> > "type" : "profiles",  
> > "bulk\_size" : "100",  
> > "bulk\_timeout" : "10ms"  
> > }  
> > }'
> > 
> > This is output of \_river/mapping. I am not sure why dynamic is true here.
> > 
> > curl -XGET '[http://localhost:9200/\_river/\_mapping?pretty=1](http://localhost:9200/_river/_mapping?pretty=1)'  
> > {  
> > "\_river" : {  
> > "profiles\_db" : {  
> > "properties" : {  
> > "couchdb" : {  
> > "dynamic" : "true",  
> > "properties" : {  
> > "db" : {  
> > "type" : "string"  
> > },  
> > "host" : {  
> > "type" : "string"  
> > },  
> > "ignore\_attachments" : {  
> > "type" : "boolean"  
> > },  
> > "last\_seq" : {  
> > "type" : "string"  
> > },  
> > "password" : {  
> > "type" : "string"  
> > },  
> > "port" : {  
> > "type" : "long"  
> > },  
> > "user" : {  
> > "type" : "string"  
> > }  
> > }  
> > },  
> > "index" : {  
> > "dynamic" : "true",  
> > "properties" : {  
> > "bulk\_size" : {  
> > "type" : "string"  
> > },  
> > "bulk\_timeout" : {  
> > "type" : "string"  
> > },  
> > "index" : {  
> > "type" : "string"  
> > },  
> > "type" : {  
> > "type" : "string"  
> > }  
> > }  
> > },  
> > "node" : {  
> > "dynamic" : "true",  
> > "properties" : {  
> > "id" : {  
> > "type" : "string"  
> > },  
> > "name" : {  
> > "type" : "string"  
> > },  
> > "transport\_address" : {  
> > "type" : "string"  
> > }  
> > }  
> > },  
> > "ok" : {  
> > "type" : "boolean"  
> > },  
> > "type" : {  
> > "type" : "string"  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > Regards,  
> > Amit
> > 
> > On Mon, Nov 5, 2012 at 2:51 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > Hi Amit,\*\*\*\*
> > > 
> > > * * *
> > > 
> > > Can you elaborate a bit more what is your concern?\*\*\*\*
> > > 
> > > If you have created first your index and type with its mapping (with all  
> > > fields that CouchDB will send), ES will not have to update it.\*\*\*\*
> > > 
> > > * * *
> > > 
> > > Can you gist your commands and what you are seeing?\*\*\*\*
> > > 
> > > * * *
> > > 
> > > David\*\*\*\*
> > > 
> > > * * *
> > > 
> > > * * *
> > > 
> > > _De :_ [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [mailto:  
> > > [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] _De la part de_ Amit Singh  
> > > _Envoyé :_ dimanche 4 novembre 2012 19:51  
> > > _À :_ [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> > > _Objet :_ How to stop couchdb river to use default dynamic mapping\*\*\*\*
> > > 
> > > * * *
> > > 
> > > How to disable Couchdb river dynamic mapping? I have my own custom  
> > > mapping and I create this mapping at time of index creation. When I  
> > > integrate couchdb with ES, my custom mappings get overridden by river's  
> > > default dynamic mapping. Not sure why this is happening.\*\*\*\*
> > > 
> > > --
> > > 
> > > * * *
> > > 
> > > --
> > 
> > --
> 
> --

--

---

<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:06am UTC](https://discuss.elastic.co/t/how-to-stop-couchdb-river-to-use-default-dynamic-mapping/9550/6 "2017-07-06T03:06:05Z")

</div>


