Member-only story
Understanding Elasticsearch Percolator Field and Ingestion Lifecycle
Elasticsearch offers powerful features for full-text search, but one lesser-known and incredibly useful tool is the Percolator. Unlike traditional search, where you query data, the Percolator flips the paradigm — you store queries and match them against documents as they are indexed.
This article focuses on the lifecycle of a percolator index, especially during document ingestion, and how Elasticsearch validates queries against the current mapping to ensure compatibility.
What Is the Percolator Field?
The percolator field type allows you to index queries instead of data. Later, when a document is ingested, Elasticsearch matches it against the stored queries to determine which queries would have matched it.
Use cases include:
- Alerting systems (e.g., notify me when a new product matches my saved search)
- Content recommendation (e.g., match job listings to user profiles)
- Reverse search indexing
Creating a Percolator Index
To use the percolator feature, the index must contain a field with the type percolator. Here's a simplified mapping:
PUT /my_percolator_index
{…