# Couchdb and elasticsearch problem.. (dynamic false)

**URL:** <https://discuss.elastic.co/t/couchdb-and-elasticsearch-problem-dynamic-false/20548>\
**Category:** Elasticsearch\
**Created:** [November 4, 2014, 2:29am UTC](https://discuss.elastic.co/t/couchdb-and-elasticsearch-problem-dynamic-false/20548 "2014-11-04T02:29:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![11170](https://avatars.discourse-cdn.com/v4/letter/1/c2a13f/32.png) [@11170](https://discuss.elastic.co/u/11170)\
**Post date:** [November 4, 2014, 2:29am UTC](https://discuss.elastic.co/t/couchdb-and-elasticsearch-problem-dynamic-false/20548/1 "2014-11-04T02:29:22Z")

</div>

sorry, I can't write English.

1. couchdb 2 document...

{  
\_id : "28f69ecd54ff0b85b4aca93183001984"  
\_rev: "1-7679a3bc485b5cf37473d106c302b9cc"  
\_name: "aaaa"  
\_price: 100  
}

{  
\_id : "28f69ecd54ff0b85b4aca93183001984"  
\_rev: "1-7679a3bc485b5cf37473d106c302b9cc"  
\_name: "aaaa"  
}

2, river

curl -XPUT "[http://localhost:9200/\_river/my\_couchdb\_idx/\_meta](http://localhost:9200/_river/my_couchdb_idx/_meta)" -d "{  
"type" : "couchdb",  
"couchdb" : {  
"host" : "192.168.0.29",  
"port" : 5984,  
"db" : "my\_couchdb",  
"last\_seq": "20000000",  
"filter" : null  
}  
}",  
my\_couchdb":{  
"mapping":{  
"my\_couchdb":{  
"dynamic":"false",  
"properties":{  
"_name":{"type":"string"_}}}}}  
}"

1. 
  - curl localhost:9200/my\_couchdb/\_mapping\*  
=\>\* { }\*  
insert new data

- curl localhost:9200/my\_couchdb/\_mapping\*  
=\> {  
"my\_kangcom" : {  
"mappings" : {  
"my\_kangcom" : {  
\* "properties" : {\*
- 

```
     "_rev" : {*

```

- 

```
       "type" : "string"*

```

- 

```
     },*

```

- 

```
     "name" : {*

```

- 

```
       "type" : "string"*

```

- 

```
     },*

```

- 

```
     "price" : {*

```

- 

```
       "type" : "long"*

```

- 

```
     }*
  }
}

```

}  
}  
}

How to custom mapping...

help me...

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/79d76e8e-8c1e-4964-8d34-87e373bb9158%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/79d76e8e-8c1e-4964-8d34-87e373bb9158%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [November 4, 2014, 2:56am UTC](https://discuss.elastic.co/t/couchdb-and-elasticsearch-problem-dynamic-false/20548/2 "2014-11-04T02:56:29Z")

</div>

Hi,

You have two options.

1. Create index before inserting the data  
You create index before registering \_river meta data.

2. create index with mappings

3. register \_river meta

4. Use Index templates  
Elasticsearch provide Index templates that allow to define templates that will automatically be applied to new indices created.

See: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html)

* * *

Jun Ohtani  
[johtani@gmail.com](mailto:johtani@gmail.com)  
blog : [http://blog.johtani.info](http://blog.johtani.info)  
twitter : [http://twitter.com/johtani](http://twitter.com/johtani)

> 2014/11/04 11:29、박재혁 [aquua77@gmail.com](mailto:aquua77@gmail.com) のメール：
> 
> sorry, I can't write English.
> 
> 1. couchdb 2 document...
> 
> {  
> \_id : "28f69ecd54ff0b85b4aca93183001984"  
> \_rev: "1-7679a3bc485b5cf37473d106c302b9cc"  
> \_name: "aaaa"  
> \_price: 100  
> }
> 
> {  
> \_id : "28f69ecd54ff0b85b4aca93183001984"  
> \_rev: "1-7679a3bc485b5cf37473d106c302b9cc"  
> \_name: "aaaa"  
> }
> 
> 2, river
> 
> curl -XPUT "[http://localhost:9200/\_river/my\_couchdb\_idx/\_meta](http://localhost:9200/_river/my_couchdb_idx/_meta)" -d "{  
> "type" : "couchdb",  
> "couchdb" : {  
> "host" : "192.168.0.29",  
> "port" : 5984,  
> "db" : "my\_couchdb",  
> "last\_seq": "20000000",  
> "filter" : null  
> }  
> }",  
> my\_couchdb":{  
> "mapping":{  
> "my\_couchdb":{  
> "dynamic":"false",  
> "properties":{  
> "name":{"type":"string"}}}}}  
> }"
> 
> 1. curl localhost:9200/my\_couchdb/\_mapping  
> =\> { }  
> insert new data  
> curl localhost:9200/my\_couchdb/\_mapping  
> =\> {  
> "my\_kangcom" : {  
> "mappings" : {  
> "my\_kangcom" : {  
> "properties" : {  
> "\_rev" : {  
> "type" : "string"  
> },  
> "name" : {  
> "type" : "string"  
> },  
> "price" : {  
> "type" : "long"  
> }  
> }  
> }  
> }  
> }  
> }
> 
> How to custom mapping...
> 
> help me...
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/79d76e8e-8c1e-4964-8d34-87e373bb9158%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/79d76e8e-8c1e-4964-8d34-87e373bb9158%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/E740F60B-A603-4FA4-91D0-BABAAF317023%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/E740F60B-A603-4FA4-91D0-BABAAF317023%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![11170](https://avatars.discourse-cdn.com/v4/letter/1/c2a13f/32.png) [@11170](https://discuss.elastic.co/u/11170)\
**Post date:** [November 4, 2014, 5:04am UTC](https://discuss.elastic.co/t/couchdb-and-elasticsearch-problem-dynamic-false/20548/3 "2014-11-04T05:04:13Z")

</div>

> curl -XPUT "[http://localhost:9200/my\_couchdb\_idx/](http://localhost:9200/my_couchdb_idx/)" -d "{
> 
> "settings": {
> 
> "number\_of\_shards": 6,
> 
> "number\_of\_replicas": 1
> 
> },
> 
> "mappings": {
> 
> ```
> "profiles": {
> 
> "dynamic": "false",
> 
> "properties": {
> 
> "name": { "type": "string"},
> 
> "email": { "type": "string"}
> 
> ```
> 
> }
> 
> }
> 
> }
> 
> }"

and then

curl -XPUT "localhost:9200/\_river/my\_couchdb\_riv/\_meta" -d "{  
"type" : "couchdb",  
"couchdb" : {  
"host" : "192.168.0.29",  
"port" : 5984,  
"db" : "my\_db\_name",  
"filter" : null,  
"last\_seq": "20000000",  
"ignore\_attachments":true},  
"index" : {  
"index" : "my\_couchdb\_idx",  
"type" : "profiles",  
"bulk\_size" : "100",  
"bulk\_timeout" : "10ms"  
}  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b7060911-c36b-445e-9e94-fc8662e320d7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b7060911-c36b-445e-9e94-fc8662e320d7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:52am UTC](https://discuss.elastic.co/t/couchdb-and-elasticsearch-problem-dynamic-false/20548/4 "2017-07-06T00:52:23Z")

</div>


