[Elasticsearch - The Definitive Guide] Updating a Whole Document.

Elastic/TheDefinitiveGuide 2015. 11. 27. 15:07

아주 기본적인 내용이라 그냥 보고 넘어 갈까 했지만, 누군가에게는 필요한 정보 일수도 있어서 기록해 봅니다.


원문링크)


Content Snippet)

Documents in Elasticsearch are immutable; we cannot change them. Instead, if we need to update an existing document, we reindex or replace it, which we can do using the same index API that we have already discussed in Indexing a Document.


종종 elasticsearch 사용하시는 분들중에 update 에 대해서 문의를 합니다.

또는 mapping 정보 변경 시, field 수정/추가 시 등등..


immutable 즉, 불변이라는 것이죠.

수정이 안됩니다. 그렇기 때문에 reindex or replace 라고 하는 것입니다.

동일 문서 ID 로 색인 요청을 하게 되면 delete -> insert 로 동작 합니다.


사용하면서 참고 하시면 좋겠습니다.

: