MJN All Blog Cheatsheets Elasticsearch GCP JS LinuxBash Misc Notes Other ShortcutKeys / - Search

Home / Elasticsearch / A High Level Overview of Elasticsearch


A High Level Overview of Elasticsearch

Structure

Terms are stored in alpha-numeric order and can be stored in a number of formats. An ordered lists of terms is good for finding word* but not *word (which would mean searching all terms). To support performant *word searches, terms are also stored in reverse order. Other manipulations of terms are done to support other complex searches - for example geo-location, number ranges and more.

Historically, Elasticsearch contained Mapping Types. These a being deprecated from v6.0.0 onwards. Mapping Types described the format of Documents in an Index and an Index could contain multiple types. From v6.0.0 onwards an Index can only contain a single Document type. This is typically called _doc but can be given a different name.

Operations

Add Document:

Delete Document:

Update Document:

Percolator

Think of this as the reverse operation of what elasticsearch does by nature: instead of sending docs, indexing them, and then running queries, one sends queries, registers them, and then sends docs and finds out which queries match that doc.

Maintenance

Index Segment Merges (automatic - but can be triggered using the API)

Slow Queries

A good way to know which queries take the more time is by using Elasticsearch slow queries logs.

PUT /index/_settings 
{
    "index.search.slowlog.threshold.query.warn: 1s",
    "index.search.slowlog.threshold.query.info: 500ms",
    "index.search.slowlog.threshold.query.debug: 1500ms",
    "index.search.slowlog.threshold.query.trace: 300ms",
    "index.search.slowlog.threshold.fetch.warn: 500ms",
    "index.search.slowlog.threshold.fetch.info: 400ms",
    "index.search.slowlog.threshold.fetch.debug: 300ms",
    "index.search.slowlog.threshold.fetch.trace: 200ms"
}

This page was generated by GitHub Pages. Page last modified: 20/11/30 18:31