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.

--

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]
De la part de Amit Singh
Envoyé : dimanche 4 novembre 2012 19:51
À : 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.

--

--

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/" -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'
{
"_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 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] De la part de Amit Singh
Envoyé : dimanche 4 novembre 2012 19:51
À : 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.****

--


--

--

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

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=1http://localhost:9200/_river/_mapping?pretty=1
'

Cheers,

Ivan

On Mon, Nov 5, 2012 at 3:23 AM, Amit Singh 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/" -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'
{
"_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 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] De la part de Amit Singh
Envoyé : dimanche 4 novembre 2012 19:51
À : 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.****

--


--

--

--

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 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

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=1http://localhost:9200/_river/_mapping?pretty=1
'

Cheers,

Ivan

On Mon, Nov 5, 2012 at 3:23 AM, Amit Singh 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/" -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'
{
"_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 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] De la part de Amit Singh
Envoyé : dimanche 4 novembre 2012 19:51
À : 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.****

--


--

--

--

--