helpers-ingest
Guide Elasticsearch Python bulk indexing, streaming, scanning, reindexing, parallel ingestion, async helpers, action validation, and partial-failure recovery.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- helpers-ingest
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guide Elasticsearch Python bulk indexing, streaming, scanning, reindexing, parallel ingestion, async helpers, action validation, and partial-failure recovery.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md2.1 KB
- 参考文档references/troubleshooting.md2.2 KB
- 参考文档references/workflows.md2.0 KB
- 脚本scripts/bulk_actions_smoke.py1.6 KB
03 SKILL.md 正文
Helpers and ingestion
Use this route for bulk indexing, updates/deletes, streaming ingestion, scan,
reindex, parallel work, or helper-specific error handling. Start with a
configured Elasticsearch or AsyncElasticsearch from
client-operations.
Choose a helper
helpers.bulk(client, actions): consume an iterable and return a count plus either an error list or (withstats_only=True) an error count.helpers.streaming_bulk(...): stream(ok, item)results and controlchunk_size,max_chunk_bytes,flush_after_seconds, retries, and whether successful items are yielded.helpers.parallel_bulk(...): parallelize chunk submission when throughput justifies the extra concurrency and ordering is not required.helpers.scan(client, query=...): scroll through matching documents; usepreserve_order=Trueonly when the ordering cost is intentional.helpers.reindex(client, source_index, target_index, ...): use the helper for server-side reindex workflows and verify target mappings/settings separately.async_bulk,async_streaming_bulk,async_scan, andasync_reindex: use withAsyncElasticsearchandawait/async foras appropriate.
Read api-reference.md for signatures and return shapes, workflows.md for action/generator recipes, and troubleshooting.md for partial failures, retries, and service errors. Run bulk_actions_smoke.py for an offline action-shape check; it never connects to a cluster.
Action contract
An action is usually a mapping containing _index, optionally _id, and a
payload. _op_type defaults to index; use create, update, or delete
explicitly. Index/create actions use the document fields; update actions use
doc, doc_as_upsert, or a script; delete actions contain metadata only.
Generate actions lazily so large input sets do not occupy memory. Validate the
index name, operation, identifiers, and JSON-serializable payload before
sending.
Safety and correctness
- Use bounded chunks and explicit retry policy. A retry on 429 can be useful; blindly retrying a non-idempotent write can duplicate effects.
- Handle
BulkIndexErroror inspect streamed item results instead of assuming a successful HTTP response means every item succeeded. - Do not run scan/reindex or index deletion against a production cluster until the query, target, privileges, and dry-run/rollback plan are reviewed.
- Route query construction to dsl-search and ES|QL construction to esql-query-builder.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).