Skip to content
Back to skills

Elasticsearch Search

ASecurity

Design and query Elasticsearch or OpenSearch indexes reliably: mappings, aliases, bulk indexing and pagination

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
developmentdatabasebackend

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill elasticsearch-search --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Elasticsearch Search?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Elasticsearch Search
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-elasticsearch-search/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-elasticsearch-search)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Design and query Elasticsearch or OpenSearch indexes reliably: mappings, aliases, bulk indexing and pagination
profile: standard
tags: search, elasticsearch, database, backend
---

# Elasticsearch search

Use when defining index mappings, writing search queries, or scaling bulk indexing pipelines.

## Mappings and index design
- Define explicit mappings and set `dynamic: "strict"` or `"runtime"` for core indexes so unexpected field types do not cause mapping explosions.
- Store exact IDs, enums, and sort/aggregation fields as `keyword`, and full-text searchable fields as `text` with tested analyzers. Never rely on `.keyword` defaults everywhere.
- Use index aliases (`orders-read`, `orders-write`) from day one so reindexing into a new mapping happens with zero downtime.

## Querying and pagination
- Put exact conditions (tenant ID, status, date ranges) inside `bool.filter` rather than `bool.must` so Elasticsearch skips scoring and caches bitsets.
- Avoid deep `from + size` pagination beyond a few thousand hits; use `search_after` paired with a Point in Time (`PIT`) and a unique tie-breaker field.

## Bulk indexing
- Batch writes through `_bulk` (5-15 MB per request), honoring 429 rejections with exponential backoff for rejected items inside the 200 response array.
- Set `refresh_interval` higher during large backfills, then restore it once caught up.

## Verify
Tests checking analyzer tokenization, filter isolation across tenants, zero-downtime alias swap, and search latency on realistic document counts.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.