1. mongodb설치와 elasticsearch설치는 알아서~
2. elasticsearch-head 플러그인 설치
plugin --install mobz/elasticsearch-head
http://localhost:9200/_plugin/head/ 관리자페이지 주소
2. elasticsearch-river-mongdb 플러그인 및 elasticsearch-mapper-attachments 설치
bin/plugin --install com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/1.6.0
bin/plugin --install elasticsearch/elasticsearch-mapper-attachments/1.6.0
3. 한글분석 플러그인 설치
bin/plugin -url https://dl-web.dropbox.com/spa/grpekzky9x5y6mc/elastic-analysis-korean/public/elasticsearch-analysis-korean-1.3.0.zip -install analysis-korean
4. 연결
curl -XPUT localhost:9200/_river/DATABASE_NAME/_meta -d '{ "type": "mongodb", "mongodb": { "servers": [ { "host": "127.0.0.1", "port": 27017 } ], "db": "DATABASE_NAME", "collection": "ACTUAL_COLLECTION_NAME", "options": { "secondary_read_preference": true }, "gridfs": false }, "index": { "name": "ARBITRARY INDEX NAME", "type": "ARBITRARY TYPE NAME" } }'
ARBITRARY INDEX NAME 소문자로만 써야
여기서 엄청 헤맴
http://stackoverflow.com/questions/23846971/how-to-use-elasticsearch-with-mongodb
Comments
Powered by Facebook Comments