Migration guide, error codes, and FAQ

Updated at:

1. Migration mapping and steps from standard Elasticsearch

Mapping between traditional regular indexes and Agentic ES Collections

Regular ES index syntax

Agentic ES syntax

PUT /products create the index

PUT /_slice_collection/products create the Collection (for a plain single table, set "default_slice": "main")

Manually set the number of primary shards, replicas, and ILM

No need to set shards or replicas (managed by the platform); only define the business mapping and the index.analysis.* analyzer settings within the allowed scope

PUT /products/_doc/1, /products/_search

The path is unchanged; for multi-tenancy pass ?_slice=xxx (or the SDK routing); for a single table, after setting default_slice, no change is needed

On a keyword / text field, run prefix / wildcard / regexp / range

Because search.allow_expensive_queries = false, this returns 400; for wildcard/regex use a wildcard field; for prefix queries, on the text field enable index_prefixes (or use search_as_you_type / wildcard); for range filters use strongly typed fields such as numeric, date, or ip (the same applies to flattened)

Rely on index templates to auto-create indexes

First explicitly call PUT /_slice_collection/{collection} to create the Collection, then write data

DELETE /products delete the index

DELETE /_slice_collection/products delete the entire Collection

Migration step checklist

  1. Review existing usage: List the indexes, mapping fields, Query DSL, aggregation methods, and client SDK versions your application currently uses (for the allowlist, see Appendix: capability allowlist).

  2. Plan the table and partition model:

    • Multi-tenant / multi-knowledge-base scenarios: merge into a single Collection, and use Slice to distinguish tenants or partitions;

    • Plain single-table scenarios: each original index maps to one Collection; when creating it, set "default_slice": "main" (business reads and writes need not pass _slice). This mode shares a single Slice quota and suits tables expected to be ≤ 10 GB, with writes ≤ 32 MiB/s and spare query concurrency (the per-Slice concurrency cap is 16); for larger scales, before creating the table split into multiple Slices by a business key that routes queries deterministically and does not change after writes (for details see Automatically create or pre-register Slices).

  3. Align the data model and optimize expensive queries:

    • If the original index used nested, join, runtime fields, runtime_mappings, or Painless scripts, switch to flattened fields or pre-compute on the application side before writing; move the data cleansing and vectorization of the original Ingest Pipeline into the application write path;

    • If there are wildcard, regexp, or fuzzy queries, change the target field to the wildcard type; if there are prefix / match_bool_prefix prefix queries, on the text field enable index_prefixes or use search_as_you_type / wildcard (for details see Wildcard and prefix fuzzy search: wildcard); if there are range filters, make sure the target field is a strongly typed field such as numeric, date, or ip (not usable on keyword / text / flattened);

    • We recommend setting "dynamic": "strict" in the mapping to enable strict field validation and prevent writing undeclared fields.

  4. Explicitly create the table and import in batches: first call PUT /_slice_collection/{collection} to create the Collection, then use _bulk to import data in batches (keep each batch within 2-5 MiB, and remove the refresh parameter from routine writes).

  5. Adapt SDK calls: for routine reads, writes, and searches, keep using the standard methods of the official SDK (for multi-tenancy, pass the Slice name via routing), remove cluster-level parameters such as _all and preference, and configure the connection pool and retries per Write data and integrate SDKs.

  6. Validate with real data: validate hot-query latency, cold-data warm-up (_warm_slice), single-batch Bulk size, and throttling-backoff logic at the target scale.

  7. Arrange the cutover and rollback window: during the bulk import of existing data, perform incremental catch-up; prepare traffic-cutover and rollback plans, and review the checklist at the end of this topic before going live.

2. Common HTTP status codes and error handling

Status code / response header

Common cause

How to handle

400 Bad Request

Request syntax error, writing an undeclared field (dynamic: strict), cursor pagination not carrying the same prefix as the first page, passing both _slice and routing, triggering the search.allow_expensive_queries = false query guard, or passing a parameter/feature that is not allowed

Do not retry as-is; fix the request or field type per the error message (for wildcard/regex use a wildcard field; for prefix queries use an index_prefixes-enabled text or search_as_you_type / wildcard; for range filters use strongly typed fields such as numeric, date, or ip; for details see Wildcard and prefix fuzzy search: wildcardRe-creating a Collection with the same name can be treated as idempotent after confirming the configuration matches).

401 / 403

Incorrect username/password, application identity mismatch, or blocked by the access whitelist

Check the application credentials, owning application, and network whitelist in the console.

404 Not Found

The Collection, Slice, document, or task does not exist (reads and searches return 404 by default when a Slice is missing; writes/updates, after disabling auto_create_slice, return 404)

Confirm the Collection and target Slice are created; for multi-Slice queries that may skip missing Slices, pass ignore_missing_slice=true; for Bulk delete where the document does not exist (no error) returning 404 can be skipped as expected.

409 Conflict

Bulk create encounters an existing _id within the same Slice, an optimistic-lock version conflict, or a _copy target Slice that is non-empty / occupied by another copy or delete task

create (insert-only): a single 409 can be skipped as expected; for a version conflict, re-read the latest data and retry; if _copy is occupied by a delete, wait for it to finish and retry; if it is occupied by another copy or the target is non-empty, use a new target name (or confirm the original task finished, delete the old target, then copy; do not treat the status_url in the conflict response as this request result).

410 Gone

Called a platform-managed or non-allowlisted cluster/ops endpoint

Do not retry; use the allowlisted Collection/Slice and search APIs instead (see Supported capability allowlist). Note: _nodes and _cluster/health return 200 only for SDK initialization handshake compatibility; do not use them for health checks.

413 Request Entity Too Large

A single HTTP request body exceeds the 100 MiB limit

Do not retry as-is; split into batches of 2-5 MiB and send.

429 (request-level)

① Per-Slice throttling triggered (query concurrency cap 16, single-document write over 32 MiB/s) or service capacity protection;

② allow_partial_search_results=false and a server-side timeout timeout triggered (search_timeout_exception)

A timeout-type 429 (search_timeout_exception) should not be retried; optimize the query or raise timeout accordingly (leave the client timeout 1-2 seconds longer than the server); a throttling-type 429 use exponential backoff with random jitter (online query clients should not auto-retry 429).

429 (Bulk per-item level)

The outer HTTP is 200, but a single item items in the response carries status: 429 (when per-Slice writes exceed 32 MiB/s, the same-batch items for that Slice return 429 as a whole; auto-creating more Slices in a batch than the default cap 512 also triggers it)

The transport layer does not auto-resend: keep each batch within 2-5 MiB and create no more than 512 new Slices per batch; handle each per-item 429 with backoff via the Bulk helper or an external retry queue (for sustained widespread 429, first slow down on the write side).

503 (right after creating a collection)

Occasional brief readiness delay when registering or writing a Slice right after creating the Collection

Retry with exponential backoff.

502 / 503 / 504

Transient gateway or node jitter

After confirming idempotency, let the client auto-retry (writes with an auto-generated _id are not idempotent; have the client generate a fixed _id; for a table-creation error, first GET to confirm the state before deciding whether to resend).

Warning response header

A URL parameter that the platform auto-ignores was passed (wait_for_active_shards, master_timeout, ignore_throttled, refresh, preference) or a non-allowed shard/replica settings, the operation already succeeded

Remove redundant parameters from the request; do not resend the write. Note: when the URL refresh is ignored, no immediate refresh is triggered (only call POST /{collection}/_refresh explicitly for very low-frequency strong-consistency debugging).

3. Frequently asked questions

Q1: After using Agentic ES, which capacity and concurrency parameters still need attention on the business side?

Underlying node specs, disk, and shards require no manual management, but the business side still needs to watch per-hot-Slice query concurrency (cap 16), per-Slice write rate (cap 32 MiB/s), single Bulk request size (recommended 2-5 MiB), and warm-up for first access to cold data.

Q2: In a single-table scenario without multi-tenant partitioning, how can calls be simplified?

When creating the Collection, set "default_slice": "main"; afterward, reads, writes, and _search can all omit _slice, making calls identical to a regular ES index; when later expanding to multiple Slices, you can still pass _slice explicitly. Note: in this mode all traffic lands on the single main Slice and is bound by the per-Slice quota (recommended ≤ 10 GB, writes ≤ 32 MiB/s, and spare query concurrency); also, once default_slice is set it cannot be renamed or cleared. For tables expected to exceed the scale, plan multiple Slices before creation; after expanding a table that has default_slice set to multiple Slices, make sure all reads and writes explicitly pass _slice, so that a missing value does not silently fall into main.

Q3: What is the difference between default_slice and auto_create_slice?

  • default_slice (default Slice): the Slice read from and written to by default when _slice is not passed (e.g. "main"); it is auto-created at table creation and cannot be renamed or cleared once set.

  • auto_create_slice (auto-create new Slices): a Collection-level switch controlling whether a Slice is auto-created when writing to or updating a not-yet-existing Slice (default true; after setting it to false, you must register before writing, and it does not affect an existing default_slice).

Q4: If documents with the same _id are written to different Slices, will they overwrite each other?

No. A document _id is unique only within a single Slice; kb-a and kb-b can both hold a document whose _id is chunk-1001, without affecting each other. To prevent overwrites within the same Slice, use create in Bulk (returns a per-item 409 when it already exists).

Q5: Why can a document not be found by _search or knn right after a successful write?

  • Reading by ID (GET /{collection}/_doc/{id}) is real-time visible by default: in normal cases the document is readable by _id immediately after a successful write (in rare failure-recovery or switchover windows it may briefly fall back to the committed view).

  • Search (_search / knn) is near-real-time visible: after a write, you must wait a few seconds for the server-side automatic background refresh before it is searchable. A debug script may retry at 1-second intervals on a miss; do not call _refresh frequently or pass the URL refresh parameter for routine writes.

Q6: Does "per-Slice query concurrency of 16" mean "only 16 queries per second (16 QPS)"?

No. 16 refers to the number of concurrent query slots being executed on the server at the same instant, not requests per second (QPS). For example, when an average query takes 50ms, a concurrency of 16 yields a theoretical peak of about 320 QPS (theoretical cap ≈ 16 / average latency). Because the throttler does not queue, and a single RRF hybrid search or MSearch batch query occupies multiple concurrency slots, production capacity planning should leave ample headroom and implement random backoff retries for throttling 429.

Q7: Why can high-concurrency writes or searches still hit 429 even with auto-retry configured?

There are three common causes (for complete per-language configuration see Write data and integrate SDKs and Continuous bulk writes):

  1. An outer Bulk 200 with an embedded per-item 429: the transport layer does not retry; use the Bulk helper or a business retry queue to handle the items array for 429.

  2. A single batch too large triggering 32 MiB/s throttling: a single write to the same Slice also cannot exceed 32 MiB; keep each batch within 2-5 MiB.

  3. A small client connection pool or improper backoff configuration: e.g. GO keeps only 2 idle connections per host by default and requires DisableRetry: true to disable retries; PYTHON has only 10 connections by default and does not sleep on status-code retries (set retry_on_status=(502, 503, 504), and handle 429 throttling at the business layer or via helpers.bulk(..., raise_on_error=False)); JAVA Rest5Client has only 10 connections per route by default; JAVASCRIPT does not retry 429 by default. Also, online query clients should not auto-retry 429 at the transport layer, to avoid resending a timeout 429.

Q8: What are the common misconceptions when copying a Slice (_copy) and deleting a Slice?

  • To judge whether _copy succeeded, check state == "SUCCEEDED": for SUCCEEDED, FAILED, and CANCELLED, completed is true in all cases; after a copy completes, searches also need a few seconds for the background refresh.

  • After deleting a Slice, data is immediately unqueryable and space is reclaimed asynchronously: if the default auto_create_slice=true is on, late-arriving write or update retries will recreate an empty Slice with the same name; before fully decommissioning a Slice, first stop writes at the application layer and drain the retry queue, then delete (it is not recommended to globally disable the Collection-level auto_create_slice for this).

4. Pre-launch checklist

  • Connection pool and read/write isolation: use the unified application endpoint from the console (not the Kibana endpoint); for writes / online fast reads / slow-query exports, separately instantiate independent Client instances (do not use the shared-connection-pool options() / child() / withTransportOptions() / child() / withTransportOptions()); enlarge the default connection pools in pairs (GO enlarge both MaxIdleConns and MaxIdleConnsPerHost, e.g. 200, configure ResponseHeaderTimeout and AutoDrainBody: true; PYTHON configure headers={"accept": "application/json"}, connections_per_node >= the number of concurrent threads, and retry_on_status=(502, 503, 504); JAVA enlarge both MaxConnTotal and MaxConnPerRoute, e.g. 200, configure disableAutomaticRetries() and idle-connection eviction).

  • Timeouts and retries: for online searches, set both a short client timeout and the server-side timeout; the online fast-read client does not auto-retry 429 or request timeouts at the transport layer (GO sets RetryOnError to skip timeouts, heavyClient sets DisableRetry: true); throttling 429 uses exponential backoff with random jitter.

  • Schema and expensive queries: the table mapping already sets "dynamic": "strict"; wildcard/regex fields already use wildcard, prefix fields already enable index_prefixes (with max_chars configured by prefix length) or use search_as_you_type / wildcard, range fields used for range filters are strongly typed such as numeric, date, or ip; removed redundant URL parameters such as _all, nested, _nodes/_cluster/health health probes, and refresh/preference.

  • Slice routing and permissions: multi-tenant requests already pass _slice (or the SDK routing, choose one) and complete tenant authentication at the application server; the single-table default_slice is confirmed within the single-Slice scale (recommended ≤ 10 GB, writes ≤ 32 MiB/s, and ample concurrency headroom).

  • Batch and long-running task handling: _bulk, _mget, _msearch, and batch Slice registration all check errors/items/responses in the response; keep each Bulk batch within 2-5 MiB and create no more than 512 new Slices per batch; judge _copy success by state == "SUCCEEDED"; Scroll updates _scroll_id each time and calls ClearScroll.

  • Cutover and rollback: incremental catch-up during bulk import, traffic-cutover and rollback plans are prepared, and console monitoring and the IP whitelist have been reviewed.