Elasticsearch Openclaw
简介
Elasticsearch Openclaw
原始描述
Read-only Elasticsearch 9.x reference for AI-orchestrated search and analytics. SECURITY: This skill provides documentation for read-only operations only (se...
通过你的 Agent 添加
安装目录:elasticsearch-openclaw/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: elasticsearch-openclaw description: > Read-only Elasticsearch 9.x reference for AI-orchestrated search and analytics. Covers modern semantic search and classic query patterns, all updated for ES 9.x. Use when working with Elasticsearch for: (1) Semantic search with JINA embeddings via Elastic Inference API, (2) semantic_text field type with automatic embedding at index/query time, (3) kNN vector search with dense_vector mappings, (4) Hybrid search combining BM25 + kNN with RRF, (5) Classic patterns: mappings, text/keyword fields, analyzers, boolean queries, aggregations, pagination, (6) Elasticsearch Python client 9.x — no body= parameter, keyword args, (7) Read-only API key creation with least-privilege scoping per index, (8) Local development with Docker via elastic.co/start-local. metadata: openclaw: emoji: 🔍 requires: anyBins: ["curl", "python3"] os: ["linux", "darwin", "win32"] env: ELASTICSEARCH_URL: "Elasticsearch cluster URL (required)" ELASTICSEARCH_API_KEY: "Base64-encoded API key (required, secret)"
Elasticsearch OpenClaw 🔍
Modern Elasticsearch 9.x patterns for AI-orchestrated applications.
🔒 Security Model: Read-Only by Design
This skill provides read-only patterns: search, aggregations, and analytics. No write operations (indexing, updates, deletions) are included to maintain a minimal security footprint for AI agent access.
Quick Start — Local Dev
For local Elasticsearch 9.x setup with Kibana, use the official start-local tool:
- Repository: https://github.com/elastic/start-local
- Documentation: https://www.elastic.co/start-local
Once running:
- Elasticsearch: http://localhost:9200
- Kibana: http://localhost:5601
- Credentials:
elastic-start-local/.env
Auth — Always Use API Keys
# Test connection
curl -s "$ELASTICSEARCH_URL" -H "Authorization: ApiKey $ELASTICSEARCH_API_KEY"
# Python client 9.x
from elasticsearch import Elasticsearch
es = Elasticsearch(ES_URL, api_key=API_KEY)
Reference Files
Load these only when needed — do not load all at once:
| File | Load when... |
|---|---|
references/semantic-search.md |
Setting up JINA, semantic_text, inference endpoint |
references/vector-search.md |
kNN queries, dense_vector mapping, hybrid search with RRF |
references/classic-patterns.md |
Mapping design, boolean queries, aggregations, pagination |
references/python-client-9.md |
Python elasticsearch 9.x — no body=, keyword args, type hints |
When to Use Each Pattern
User asks about meaning / intent / "find products like X"
→ semantic_text + semantic query → references/semantic-search.md
User needs exact match + semantic combined
→ hybrid search (RRF) → references/vector-search.md
User asks about mapping, field types, analyzers, aggregations
→ classic patterns → references/classic-patterns.md
User uses Python elasticsearch library
→ always check → references/python-client-9.md
Security Best Practices
- Always use API keys over username/password
- Scope API keys to specific indices and minimal privileges
- For read-only OpenClaw access:
privileges: ["read", "view_index_metadata"] - Store credentials in
.env, never hardcode in scripts .envalways in.gitignore
POST /_security/api_key
{
"name": "openclaw-readonly",
"role_descriptors": {
"reader": {
"indices": [{ "names": ["my-index"], "privileges": ["read"] }]
}
}
}
// Response:
{
"id": "VuaCfGcBCdbkQm-e5aOx",
"name": "openclaw-readonly",
"api_key": "ui2lp2axTNmsyakw9tvNnw",
"encoded": "VnVhQ2ZHY0JDZGJrUW0tZTVhT3g6dWkybHAyYXhUTm1zeWFrdzl0dk5udw=="
}
⚠️ Save the encoded field from the response immediately — it cannot be retrieved later.
Add to: ~/.openclaw/workspace-[name]/.env as ELASTICSEARCH_API_KEY
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。