[elasticsearch] Indices API - Put Mapping

Elastic/Elasticsearch 2013. 4. 17. 11:32

본 문서는 개인적인 테스트와 elasticsearch.org 그리고 community 등을 참고해서 작성된 것이며,

정보 교환이 목적입니다.


잘못된 부분에 대해서는 지적 부탁 드립니다.

(예시 코드는 성능 및 보안 검증이 되지 않았습니다.)



[elasticsearch API 리뷰]

원문 링크 : http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping/


이 API 는 Mapping type  을 정의 할 수 있도록 합니다.


[Merging & Conflicts]

- 이미 존재 하는 field 에 다른 type 으로 mapping 시도 시 merge & conflict 동작을 하게 됩니다.

- ignore_conflicts 설정을 true 로 할 경우 다른 type 에 대한 conflict 에러를 회피 할 수 있습니다.

- 하지만, 정상적인 동작은 하지 않는다는 점에 주의를 하셔야 합니다.

kimchy said :

You can't change the type of a field mapped, even when ignore_conflicts is set to true. Ignore conflicts simply does that, ignore the conflicts and applies what it can, it does not apply conflicts.



※ 정리 하면,

- 기정의한 field type 에 대한 변경을 하지 않도록 유의 합니다.

- 만약 변경이 필요 하다면, object type 으로 신규 추가 하거나 multi field 를 활용 하시기 바랍니다.


: