mongodb와 elasticsearch 연동

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

댓글 남기기

당신의 이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다.

*

다음의 HTML 태그와 속성을 사용할 수 있습니다: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>