elasticsearch
Elasticsearch distributed search and analytics engine
Works with
---
name: elasticsearch
description: Elasticsearch distributed search and analytics engine
license: MIT
---
## What I do
- Design Elasticsearch indices
- Write complex queries
- Use aggregations
- Configure analyzers
- Handle mappings
- Optimize performance
- Use Beats and Logstash
## When to use me
When building full-text search, log analytics, or real-time applications.
## Mappings
```json
{
"mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "english",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"content": {
"type": "text"
},
"author": {
"type": "keyword"
},
"published_at": {
"type": "date"
},
"views": {
"type": "integer"
},
"tags": {
"type": "keyword"
},
"location": {
"type": "geo_point"
}
}
}
}
```
## Queries
```json
// Match query
{
"query": {
"match": {
"title": "elasticsearch guide"
}
}
}
// Boolean query
{
"query": {
"bool": {
"must": [
{ "match": { "title": "elasticsearch" } }
],
"filter": [
{ "term": { "status": "published" } }
],
"should": [
{ "match": { "content": "tutorial" } }
],
"must_not": [
{ "term": { "author": "banned" } }
]
}
}
}
// Multi-match
{
"query": {
"multi_match": {
"query": "search engine",
"fields": ["title^2", "content"]
}
}
}
// Nested query
{
"query": {
"nested": {
"path": "comments",
"query": {
"match": { "comments.text": "great" }
}
}
}
}
```
## Aggregations
```json
{
"size": 0,
"aggs": {
"avg_views": {
"avg": { "field": "views" }
},
"by_status": {
"terms": { "field": "status" }
},
"by_author": {
"terms": { "field": "author", "size": 10 }
},
"publish_dates": {
"date_histogram": {
"field": "published_at",
"calendar_interval": "month"
}
}
}
}
```
## Ingest Pipeline
```json
{
"description": "Process logs",
"processors": [
{
"grok": {
"field": "message",
"patterns": ["%{TIMESTAMP:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:message}"]
}
},
{
"date": {
"field": "timestamp",
"formats": ["ISO8601"]
}
},
{
"lowercase": {
"field": "level"
}
},
{
"remove": {
"field": "timestamp"
}
}
]
}
```
## Python Client
```python
from elasticsearch import Elasticsearch
es = Elasticsearch(["http://localhost:9200"])
# Create index
es.indices.create(index="documents", body={
"mappings": {
"properties": {
"title": {"type": "text"},
"content": {"type": "text"},
"date": {"type": "date"}
}
}
})
# Index document
es.index(index="documents", id=1, body={
"title": "Elasticsearch Guide",
"content": "Learn Elasticsearch",
"date": "2024-01-01"
})
# Search
result = es.search(index="documents", body={
"query": {
"match": {"content": "elasticsearch"}
}
})
for hit in result["hits"]["hits"]:
print(hit["_source"])
```
## Performance Tips
```json
// Filter context over query for filters
{
"query": {
"bool": {
"filter": [ // Use filter, not must
{ "term": { "status": "active" } }
]
}
}
}
// Pagination
{
"query": { "match_all": {} },
"from": 10000,
"size": 10
}
// Better: search_after for deep pagination
{
"query": { "match_all": {} },
"search_after": ["value", "id"],
"size": 10
}
```More SEO & Marketing skills
ai-video-generation
skills-101/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
skills-101/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image
ai-avatar-video
skills-101/superpowers
Create AI avatar and talking head videos via inference.sh CLI. Recommended: P-Video-Avatar (fastest, cheapest, built-in TTS). Also: OmniHuman, Fabric, PixVerse. Audio: Inworld TTS-2 (100+ languages, emotion steering for characters), ElevenLabs, Kokoro. Capabilities: audio-driven avatars, text-to-avatar, lipsync videos, talking head generation, virtual presenters, UGC content. Use for: AI presenters, explainer videos, virtual influencers, dubbing, marketing videos, UGC ads, gaming avatars, NPC dialogue. Triggers: ai avatar, talking head, lipsync, avatar video, virtual presenter, ai spokesperson, audio driven video, heygen alternative, synthesia alternative, talking avatar, lip sync, video avatar, ai presenter, digital human, ugc, ugc video, ugc ad, avatar ugc

