elasticsearch couchdb를 river로 연동할 때 mapping 문제.
river에서 자동으로 mapping을 설정해 준다. 괜히 필요하지 않은 데이터, 내가 필요한 데이터를 사용못하는 문제가 있다.
자동은 편하지만 불편하다.
내가 원하는 mapping을 사용하기 위해서는.
1. mapping을 만든다.
2. river생성할 때 이미 만든 mapping을 호출한다.
1.mapping 생성
curl -XPUT "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"}
}
}
}
}"
2. river 생성
curl -XPUT "localhost:9200/_river/my_couchdb_riv/_meta" -d "{
"type" : "couchdb",
"couchdb" : {
"host" : "192.168.0.29",
"port" : 5984,
"db" : "my_couchdb",
"filter" : null,
"last_seq": "20000000",
"ignore_attachments":true},
"index" : {
"index" : "my_couchdb_idx",
"type" : "profiles",
"bulk_size" : "100",
"bulk_timeout" : "10ms"
}
}"