elasticsearch-py
Guide the official Elasticsearch Python client for cluster connections, generated APIs, async code, bulk ingestion, query DSL, ES|QL, optional integrations, and runtime troubleshooting.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- elasticsearch-py
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guide the official Elasticsearch Python client for cluster connections, generated APIs, async code, bulk ingestion, query DSL, ES|QL, optional integrations, and runtime troubleshooting.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/repo-provenance.md1.1 KB
- 参考文档references/repo-routing-metadata.json335 B
- 参考文档references/troubleshooting.md2.0 KB
03 SKILL.md 正文
Elasticsearch Python client
Use this skill when a task uses the official elasticsearch Python package or
asks for Elasticsearch connections, indexing/search APIs, async client code,
bulk helpers, the high-level DSL, ES|QL, vector-store helpers, or client
troubleshooting. The source snapshot is package version 9.5.0; read
repo-provenance.md before deciding whether the
skill is stale for a different client checkout or version.
Route the request
- Connect, authenticate, configure transport, use generated API namespaces, or manage sync/async lifecycle: read client-operations.
- Bulk index/update/delete, streaming, scan, reindex, or helper failures: read helpers-ingest.
Q,Search, aggregations, mappings,Document, typed persistence, or high-level query composition: read dsl-search.- ES|QL source/processing builders, safe parameters, or tabular results: read esql-query-builder.
- Shared install, serialization, version, or security failures: read troubleshooting.md in addition to the route.
For a cross-cutting task, load client-operations first, then the workflow route; keep the client/auth configuration separate from request-body construction.
Install and smoke check
The package supports Python 3.10+. Install only the extras used by the task:
python -m pip install elasticsearch
python -m pip install "elasticsearch[async]" # aiohttp async transport
python -m pip install "elasticsearch[requests]" # requests transport
python -m pip install "elasticsearch[orjson]" # optional serializer
python -m pip install "elasticsearch[pyarrow]" # Arrow/ES|QL workflows
python -m pip install "elasticsearch[vectorstore_mmr]" # MMR helper support
from elasticsearch import AsyncElasticsearch, Elasticsearch
print(Elasticsearch, AsyncElasticsearch)
An import proves package availability only. client.info() is a live service
probe and requires a reachable endpoint, credentials, and correct TLS.
Guardrails
- Keep API keys, passwords, bearer tokens, CA files, and cluster URLs in runtime configuration or environment variables, not in generated guidance or logs.
- Prefer TLS verification with
ca_certsor a supported fingerprint. Do not useverify_certs=Falseas a production solution. - Generated client modules are specification output; do not edit files under
elasticsearch/_sync/client/orelasticsearch/_async/client/to change an API. Upstream API changes belong in the Elasticsearch specification project. - A bulk HTTP response can contain item failures. Inspect helper results and use bounded retries only for operations whose retry semantics are understood.
- A rendered DSL/ES|QL request is not server validation. Check target mappings, server version, privileges, response shape, and partial-result flags.
- Close clients:
client.close()for sync andawait client.close()for async, preferably with an async context manager.
Verification entry points
Use the bundled offline checks when no cluster is available:
python sub-skills/helpers-ingest/scripts/bulk_actions_smoke.pypython sub-skills/dsl-search/scripts/dsl_query_smoke.pypython sub-skills/esql-query-builder/scripts/esql_query_smoke.py
Read routing metadata only when the managed repo-skill router is being rebuilt; it is structured metadata, not a user workflow reference.
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).