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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.