소스 정보
- 저장소
- ffsshhttiikk/opencode-agents-skills
- 최근 소스 활동
- 2026년 2월 28일 22:49
- 감지된 SKILL.md 언어
- 영어
- 스타
- 2
- 포크
- 2
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill elasticsearch명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | elasticsearch |
| description | Elasticsearch full-text search engine, indexing strategies, and aggregations |
| category | databases |
I am a distributed, RESTful search and analytics engine built on Apache Lucene. I excel at full-text search, structured search, analytics, logging, and metrics use cases. I provide near-real-time search capabilities, horizontal scalability, and powerful aggregation frameworks for building search experiences, log analytics dashboards, and operational intelligence platforms. I am the backbone of the ELK (Elasticsearch, Logstash, Kibana) stack.
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import NotFoundError, ConflictError
from datetime import datetime
es = Elasticsearch(["http://localhost:9200"])
def create_product_index():
mapping = {
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1,
"analysis": {
"analyzer": {
"product_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase", "asciifolding", "product_synonyms"]
}
},
"filter": {
"product_synonyms": {
"type": "synonym",
"synonyms": [
"laptop, notebook, portable computer",
"phone, smartphone, mobile"
]
}
}
}
},
"mappings": {
"properties": {
"name": {"type": "text", "analyzer": "product_analyzer"},
"description": {"type": "text", : },
: {: },
: {: },
: {: },
: {: },
: {: },
: {: },
: {: },
: {: }
}
}
}
es.indices.create(index=, body=mapping)
():
product_doc = {
**product_data,
: datetime.utcnow().isoformat()
}
es.index(index=, =product_data[], document=product_doc)
():
:
es.get(index=, =SKU)
NotFoundError:
():
es.update(index=, =SKU, doc=updates)
():
es.delete(index=, =SKU)
():
operations = []
product products:
operations.append({: {: , : product[]}})
operations.append({**product, : datetime.utcnow().isoformat()})
es.bulk(operations=operations, refresh=)
def search_products(query, filters=None, page=1, per_page=20):
search_query = {
"query": {
"bool": {
"must": [
{"multi_match": {
"query": query,
"fields": ["name^3", "description", "tags^2"],
"type": "best_fields",
"fuzziness": "AUTO"
}}
],
"filter": []
}
},
"from": (page - 1) * per_page,
"size": per_page,
"sort": [
{"_score": "desc"},
{"rating": "desc"},
{"price": "asc" if filters.get("sort") == "price_asc" else "desc"}
],
"highlight": {
"fields": {
"name": {},
"description": {"fragment_size": 150}
}
}
}
if filters:
if "category" in filters:
search_query["query"]["bool"][].append({: {: filters[]}})
filters:
search_query[][][].append({: {: {: filters[]}}})
filters:
search_query[][][].append({: {: {: filters[]}}})
filters:
search_query[][][].append({: {: filters[]}})
filters:
search_query[][][].append({: {: filters[]}})
es.search(index=, body=search_query)
():
es.search(index=, body={
: {
: {
field: {: prefix, : }
}
},
: limit,
: [, , ]
})
():
es.search(index=, body={
: {
: {
: {: {}},
: [
{: {: , : , : , : }},
{: {: {: }}, : }
],
: ,
:
}
},
:
})
():
es.search(index=, body={
: {
: {
: query,
: [, ],
: fuzziness
}
}
})
():
es.search(index=, body={
: {
: {
: [, , ],
: [{: , : SKU}],
: ,
: ,
:
}
},
: limit
})
def get_product_aggregations(category_filter=None):
query = {"match_all": {}} if not category_filter else {"term": {"category": category_filter}}
return es.search(index="products", body={
"query": query,
"size": 0,
"aggs": {
"categories": {"terms": {"field": "category", "size": 50}},
"price_stats": {"stats": {"field": "price"}},
"price_ranges": {
"range": {
"field": "price",
"ranges": [
{"key": "budget", "to": 50},
{"key": "mid-range", "from": 50, "to": 200},
{"key": "premium", "from": 200}
]
}
},
"avg_rating_by_category": {
"terms": {"field": "category", : },
: {
: {: {: }}
}
},
: {: {: , : }},
: {: {: }}
}
})
():
es.search(index=, body={
: {
: {: {: start_date, : end_date}}
},
: ,
: {
: {
: {
: ,
:
},
: {
: {: {: }},
: {: {: }},
: {: {: }}
}
},
: {
: {: },
: {
: {: {: }}
}
}
}
})
():
es.search(index=, body={
: {: {}},
: ,
: {
: {
: {: , : limit},
: {
: {: {: }},
: {: {: }}
}
}
}
})
():
es.search(index=, body={
: {: {}},
: ,
: {
: {
: {: , : interval},
: {
: {: {: metric_field}},
: {: {: metric_field}},
: {: {: metric_field}},
: {: {: metric_field, : [, , , ]}}
}
}
}
})
def search_nearby_stores(location, radius_km=10, limit=20):
return es.search(index="stores", body={
"query": {
"bool": {
"must": {"match_all": {}},
"filter": {
"geo_distance": {
"distance": f"{radius_km}km",
"location": location
}
}
}
},
"sort": [
{"_geo_distance": {
"location": location,
"order": "asc",
"unit": "km"
}}
],
"size": limit
})
def search_stores_in_bounds(top_left, bottom_right):
return es.search(index="stores", body={
"query": {
"geo_bounding_box": {
"location": {
"top_left": top_left,
"bottom_right": bottom_right
}
}
}
})
def aggregate_by_location(grid_size="50km"):
return es.search(index="stores", body={
"size": 0,
"aggs": {
: {
: {
: ,
: ,
:
},
: {
: {: {: }},
: {: {: }}
}
}
}
})
():
es.search(index=, body={
: {
: {
: {: polygon}
}
}
})
def refresh_index(index_name):
return es.indices.refresh(index=index_name)
def force_merge_index(index_name, max_segments=1):
return es.indices.forcemerge(index=index_name, max_num_segments=max_segments)
def update_index_settings(index_name, settings):
return es.indices.put_settings(index=index_name, body=settings)
def get_index_stats(index_name):
return es.indices.stats(index=index_name)
def create_index_alias(index_name, alias_name):
return es.indices.put_alias(index=index_name, name=alias_name)
def rollover_index(alias_name, max_age="7d", max_docs=100000):
return es.indices.rollover(alias=alias_name, conditions={
"max_age": max_age,
"max_docs": max_docs
})
def reindex_from_remote(source_index, dest_index):
return es.reindex(body={
"source": {"remote": {"host": "http://old-cluster:9200"}, "index": source_index},
"dest": {"index": dest_index}
}, wait_for_completion=True)
def delete_old_indices(pattern="logs-*", older_than_days=):
datetime datetime, timedelta
cutoff = datetime.utcnow() - timedelta(days=older_than_days)
indices = es.cat.indices(index=pattern, h=).splitlines()
deleted = []
line indices:
line.strip():
parts = line.split()
index_name = parts[]
creation_date = datetime.fromisoformat(parts[].replace(, ).split()[])
creation_date < cutoff:
es.indices.delete(index=index_name)
deleted.append(index_name)
deleted