Migration guide, error codes, and FAQ
1. Migration mapping and steps from standard Elasticsearch
Mapping between traditional regular indexes and Agentic ES Collections
|
Regular ES index syntax |
Agentic ES syntax |
|
|
|
|
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 |
|
|
The path is unchanged; for multi-tenancy pass |
|
On a |
Because |
|
Rely on index templates to auto-create indexes |
First explicitly call |
|
|
|
Migration step checklist
-
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).
-
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/sand spare query concurrency (the per-Slice concurrency cap is16); 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).
-
-
Align the data model and optimize expensive queries:
-
If the original index used
nested,join,runtimefields,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, orfuzzyqueries, change the target field to thewildcardtype; if there areprefix/match_bool_prefixprefix queries, on thetextfield enableindex_prefixesor usesearch_as_you_type/wildcard(for details see Wildcard and prefix fuzzy search: wildcard); if there arerangefilters, make sure the target field is a strongly typed field such as numeric,date, orip(not usable onkeyword/text/flattened); -
We recommend setting
"dynamic": "strict"in the mapping to enable strict field validation and prevent writing undeclared fields.
-
-
Explicitly create the table and import in batches: first call
PUT /_slice_collection/{collection}to create the Collection, then use_bulkto import data in batches (keep each batch within2-5 MiB, and remove therefreshparameter from routine writes). -
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_allandpreference, and configure the connection pool and retries per Write data and integrate SDKs. -
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. -
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 |
|
|
Request syntax error, writing an undeclared field ( |
Do not retry as-is; fix the request or field type per the error message (for wildcard/regex use a |
|
|
Incorrect username/password, application identity mismatch, or blocked by the access whitelist |
Check the application credentials, owning application, and network whitelist in the console. |
|
|
The Collection, Slice, document, or task does not exist (reads and searches return |
Confirm the Collection and target Slice are created; for multi-Slice queries that may skip missing Slices, pass |
|
|
Bulk |
|
|
|
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: |
|
|
A single HTTP request body exceeds the |
Do not retry as-is; split into batches of |
|
|
① Per-Slice throttling triggered (query concurrency cap ② |
A timeout-type |
|
|
The outer HTTP is |
The transport layer does not auto-resend: keep each batch within |
|
|
Occasional brief readiness delay when registering or writing a Slice right after creating the Collection |
Retry with exponential backoff. |
|
|
Transient gateway or node jitter |
After confirming idempotency, let the client auto-retry (writes with an auto-generated |
|
|
A URL parameter that the platform auto-ignores was passed ( |
Remove redundant parameters from the request; do not resend the write. Note: when the URL |
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_sliceis 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 (defaulttrue; after setting it tofalse, you must register before writing, and it does not affect an existingdefault_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_idimmediately 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_refreshfrequently or pass the URLrefreshparameter 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):
-
An outer Bulk
200with an embedded per-item429: the transport layer does not retry; use the Bulk helper or a business retry queue to handle theitemsarray for429. -
A single batch too large triggering
32 MiB/sthrottling: a single write to the same Slice also cannot exceed32 MiB; keep each batch within2-5 MiB. -
A small client connection pool or improper backoff configuration: e.g.
GOkeeps only2idle connections per host by default and requiresDisableRetry: trueto disable retries;PYTHONhas only10connections by default and does not sleep on status-code retries (setretry_on_status=(502, 503, 504), and handle429throttling at the business layer or viahelpers.bulk(..., raise_on_error=False));JAVARest5Clienthas only10connections per route by default;JAVASCRIPTdoes not retry429by default. Also, online query clients should not auto-retry429at the transport layer, to avoid resending a timeout429.
Q8: What are the common misconceptions when copying a Slice (_copy) and deleting a Slice?
-
To judge whether
_copysucceeded, checkstate == "SUCCEEDED": forSUCCEEDED,FAILED, andCANCELLED,completedistruein 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=trueis 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-levelauto_create_slicefor 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
Clientinstances (do not use the shared-connection-pooloptions()/child()/withTransportOptions()/ child() / withTransportOptions()); enlarge the default connection pools in pairs (GOenlarge bothMaxIdleConnsandMaxIdleConnsPerHost, e.g.200, configureResponseHeaderTimeoutandAutoDrainBody: true;PYTHONconfigureheaders={"accept": "application/json"},connections_per_node >= the number of concurrent threads, andretry_on_status=(502, 503, 504);JAVAenlarge bothMaxConnTotalandMaxConnPerRoute, e.g.200, configuredisableAutomaticRetries()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-retry429or request timeouts at the transport layer (GOsetsRetryOnErrorto skip timeouts,heavyClientsetsDisableRetry: true); throttling429uses exponential backoff with random jitter. -
Schema and expensive queries: the table mapping already sets
"dynamic": "strict"; wildcard/regex fields already usewildcard, prefix fields already enableindex_prefixes(withmax_charsconfigured by prefix length) or usesearch_as_you_type/wildcard,rangefields used for range filters are strongly typed such as numeric,date, orip; removed redundant URL parameters such as_all,nested,_nodes/_cluster/healthhealth probes, andrefresh/preference. -
Slice routing and permissions: multi-tenant requests already pass
_slice(or the SDKrouting, choose one) and complete tenant authentication at the application server; the single-tabledefault_sliceis 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 checkerrors/items/responsesin the response; keep each Bulk batch within2-5 MiBand create no more than512new Slices per batch; judge_copysuccess bystate == "SUCCEEDED";Scrollupdates_scroll_ideach time and callsClearScroll. -
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.