대량 인덱싱 및 대량 API
대량 API를 사용해 수천 개의 문서를 효율적으로 인덱싱하고 부분 실패를 처리하는 방법을 익혀 보세요.
대량 인덱싱 및 대량 API은(는) CoddyKit의 무료 Elasticsearch & Full Text Search Systems 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Elasticsearch & Full Text Search Systems 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Why Bulk
Indexing documents one HTTP request at a time is slow. The Bulk API packs many operations into a single request, dramatically improving throughput.
The NDJSON Format
Bulk requests use newline-delimited JSON: each action line is followed by its source line (for index/create/update). Every line ends with a newline, including the last.
A Basic Bulk Request
Here two documents are indexed in one call.
POST /products/_bulk
{ "index": { "_id": "1" } }
{ "name": "Keyboard", "price": 40 }
{ "index": { "_id": "2" } }
{ "name": "Mouse", "price": 20 }Supported Actions
Bulk supports four actions:
index— create or replacecreate— fail if the id existsupdate— partial updatedelete— no source line needed
Mixing Actions
A single bulk body can mix actions and even target different indices via the action metadata.
POST /_bulk
{ "delete": { "_index": "products", "_id": "3" } }
{ "update": { "_index": "products", "_id": "1" } }
{ "doc": { "price": 45 } }Partial Failures
Crucially, the bulk request itself returns 200 OK even if some items fail. You must inspect the errors flag and per-item status.
// response
{ "errors": true, "items": [ { "index": { "status": 201 } },
{ "index": { "status": 409 } } ] }Choosing a Batch Size
There is no perfect number, but 1,000 to 5,000 documents (or a few megabytes) per bulk request is a good starting range. Measure and adjust for your data.
Tuning for Heavy Loads
For huge initial loads, temporarily disable the refresh interval and reduce replicas, then restore them afterward.
PUT /products/_settings
{ "index": { "refresh_interval": "-1",
"number_of_replicas": 0 } }Restore After Load
Once the bulk load finishes, re-enable refresh and replicas so the data becomes searchable and durable.
PUT /products/_settings
{ "index": { "refresh_interval": "1s",
"number_of_replicas": 1 } }Retrying Failures
A status of 429 (too many requests) means the cluster is overloaded. Retry only the failed items with exponential backoff, not the whole batch.
Client Helpers
Official clients provide bulk helpers that chunk, send, and retry automatically, so you rarely build NDJSON by hand in production.
Quick Check
A bulk request returns HTTP 200. Is everything fine?
Recap
You learned the Bulk API: the NDJSON format, the four actions, why partial failures need per-item inspection, sensible batch sizes, load-time tuning of refresh and replicas, and retrying 429s with backoff.
자주 묻는 질문
“대량 인덱싱 및 대량 API” 강의는 무료인가요?
네 — “대량 인덱싱 및 대량 API” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Elasticsearch & Full Text Search Systems 강의 전체를 잠금 해제할 수 있습니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.
“대량 인덱싱 및 대량 API”에서 뭘 배우나요?
대량 API를 사용해 수천 개의 문서를 효율적으로 인덱싱하고 부분 실패를 처리하는 방법을 익혀 보세요. 브라우저에서 직접 실행하는 실습 코드로 Elasticsearch & Full Text Search Systems을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Elasticsearch & Full Text Search Systems을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Elasticsearch & Full Text Search Systems은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.
“대량 인덱싱 및 대량 API” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Elasticsearch & Full Text Search Systems 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Elasticsearch & Full Text Search Systems 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 엘라스틱서치에 문서 인덱싱
- 문서를 활용한 CRUD 작업
- 기본 매핑 및 데이터 유형
- 대량 인덱싱 및 대량 API