2.X/1. Getting Started

1-10-11. Reindexing Your Data

drscg 2017. 9. 30. 16:53

Although you can add new types to an index, or add new fields to a type, you can’t add new analyzers or make changes to existing fields. If you were to do so, the data that had already been indexed would be incorrect and your searches would no longer work as expected.

index에 새로운 type을 추가하거나 type에 새로운 field를 추가할 있지만, 새로운 analyzer를 추가하거나 기존 field를 변경할 수 없다. 그렇게 하면, 기존의 색인 데이터는 올바르지 않게 되고, 검색은 더 이상 기대했던 대로 동작하지 않을 것이다.

The simplest way to apply these changes to your existing data is to reindex: create a new index with the new settings and copy all of your documents from the old index to the new index.

기존 데이터에 이러한 변경을 적용하는, 가장 단순한 방법은 다시 색인 하는 것이다. 새로운 설정을 가진 새로운 index를 생성하고, 기존의 index에서 새로운 index로 모든 document를 복사하는 것이다.

One of the advantages of the _source field is that you already have the whole document available to you in Elasticsearch itself. You don’t have to rebuild your index from the database, which is usually much slower.

_source field의 장점 중 하나는, Elasticsearch 자체에, 이용할 수 있는 전체 document를 이미 가지고 있다는 것이다. 데이터베이스로부터 index를 다시 만들 필요가 없다. 그리고 일반적으로, 이것은 훨씬 더 느리다.

To reindex all of the documents from the old index efficiently, use scroll to retrieve batches of documents from the old index, and the bulk API to push them into the new index.

기존 index에서 document 모두를 효율적으로 다시 색인 하기 위해, 기존 index에서 document를 일괄적으로 가져올 수 있는 scroll을 사용하고, bulk API로 새로운 index에 밀어 넣자.


'2.X > 1. Getting Started' 카테고리의 다른 글

1-10-09. Customizing Dynamic Mapping  (0) 2017.09.30
1-10-10. Default Mapping  (0) 2017.09.30
1-10-12. Index Aliases and Zero Downtime  (0) 2017.09.30
1-11. Inside a Shard  (0) 2017.09.30
1-11-1. Making Text Searchable  (0) 2017.09.30