elasticsearch

Elasticsearch search and analytics engine with full-text search. Use for search and logging.

7 stars

Best use case

elasticsearch is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Elasticsearch search and analytics engine with full-text search. Use for search and logging.

Teams using elasticsearch should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/elasticsearch/SKILL.md --create-dirs "https://raw.githubusercontent.com/G1Joshi/Agent-Skills/main/skills/databases/elasticsearch/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/elasticsearch/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How elasticsearch Compares

Feature / AgentelasticsearchStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Elasticsearch search and analytics engine with full-text search. Use for search and logging.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Elasticsearch

Elasticsearch is a distributed search and analytics engine built on Apache Lucene. It is the heart of the ELK Stack (Elastic, Logstash, Kibana) and a leading Vector Database for AI.

## When to Use

- **Full-Text Search**: "Did you mean?" suggestions, fuzzy search, relevance scoring.
- **Log Analytics**: Storing terabytes of logs (Observability).
- **Vector Search (2025)**: Storing embeddings for Semantic Search / RAG.

## Quick Start

```bash
# REST API - Search for "bike"
GET /products/_search
{
  "query": {
    "match": {
      "description": "bike"
    }
  }
}
```

## Core Concepts

### Inverted Index

Maps words to documents. "Bike" -> [Doc1, Doc5]. Makes text search nearly instant.

### Shards & Replicas

- **Shard**: A slice of the index. Distributes data across nodes.
- **Replica**: Copy of a shard for High Availability.

### ES|QL (2024+)

Elasticsearch Query Language. A piped language (like SQL/Splunk) to simplify querying.
`FROM logs | WHERE status == 500 | LIMIT 10`

## Best Practices (2025)

**Do**:

- **Use `kNN` Search**: Native vector search support for AI applications.
- **Use ILM (Index Lifecycle Management)**: Move old logs to cheaper cold storage automatically.
- **Use Datastreams**: Optimized abstraction for time-series/logs (append-only).

**Don't**:

- **Don't use as primary source of truth**: It is eventually consistent and partition-tolerant, but relational DBs are safer for "money" data.
- **Don't oversight mapping explosion**: Too many unique fields map crash the cluster.

## References

- [Elasticsearch Guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)