Appendix E. Turning search upside down with the percolator

The Elasticsearch percolator is typically defined as “search upside down” for the following reasons:

  • You index queries instead of documents. This registers the query in memory, so it can be quickly run later.
  • You send a document to Elasticsearch instead of a query. This is called percolating a document, basically indexing it into a small, in-memory index. Registered queries are run against the small index, so Elasticsearch finds out which queries match.
  • You get back a list of queries matching the document, instead of the other way around like a regular search.

The typical use case for percolation is alerting. As shown in figure E.1, you can notify users when new documents (matching ...

Get Elasticsearch in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.