视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
dsl-search【文档与办公】Guide elasticsearch.dsl query and search composition, mappings, typed Documents, aggregations, pagination, persistence, and sync/async DSL workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this route when a task asks for Q, Search, aggregations, filters,
mappings, Document, Index, FacetedSearch, or a high-level query that
should be rendered to the Elasticsearch request body. Use
client-operations for client/auth setup and
helpers-ingest for bulk/scan/reindex.
Q object for reusable query fragments, combining with & (AND),
| (OR), and ~ (NOT). Use .to_dict() before sending when debugging.Search(index=...) and chain .query(...),
.filter(...), .exclude(...), .sort(...), .source(...), .extra(...),
.params(...), .aggs.bucket(...), or .execute().Document/InnerDoc classes and Field objects when the mapping,
validation, persistence, and typed result behavior are worth the extra
structure. Create the index/mapping before saving documents.AsyncElasticsearch; await execution and close
the client. Render queries offline before any cluster call.Read api-reference.md for the public object model, workflows.md for compositional recipes, data-and-mapping.md for mappings and typed documents, and troubleshooting.md for validation, response, and version failures. Run scripts/dsl_query_smoke.py for an offline check.
from elasticsearch.dsl import Q, Search
query = Q("bool", must=[Q("match", title="python")], filter=[Q("term", status="published")])
request = Search(index="books").query(query).sort("_score").source(["title"])
assert request.to_dict()["query"]["bool"]["must"][0] == {"match": {"title": "python"}}
# response = request.execute() # requires a configured live cluster
The DSL is a request builder, not a server-side validator. A rendered request can still fail because the index mapping, Elasticsearch version, privileges, or query feature is incompatible.