7 min total

Vector Databases

Elastic Search

Elastic Search

ELK stack: Elastic search | logstah | kibana

Elastic search:
stores documents in json
builds inverted indexes
supports → full text search | filters | aggregations | vector search
scales horizontally

typical uses → search engines | log search | security analytics | metrics

we interact with ES via RESTful apis

Relational databaseES
DatabaseIndexes
tablepatter/types
rowsDocuments
columnfields



Logstash:
data ingestion and transformation pipeline
collects data from files, kafka, syslogs
parses and transforms regex, json parsin, enrichment

text
example raw log: 
192.168.1.5 - - [27/Jan/2026] "GET /login 401"

after processing with logstash:
{
  "ip": "192.168.1.5",
  "endpoint": "/login",
  "status": 401,
  "timestamp": "2026-01-27T10:31:00"
}

now ES can index this properly


Kibana: visualization layer for elastic search
lets you build dashboards, plot time series, create heatmaps, do ad-hoc searches

allows us to interact with elastic search visually


Elastic search applies algorithms such as:

  1. inverted index
  2. BM25/TF-IDF
  3. Fuzzy search
  4. stemming, lowercasing, stop words, synonyms
  5. partial matchings via n-grams
  6. phrase and proximity search
  7. filters

ES cluster: set of VMs

ES Node: a VM instance

Index: database

ES ID: primary key


all possible Node roles

master node: eligible to be a master role

data node: can perform CRUD operations

ingest node:

….


ES shard: self contained lucene index that holds a subset of your documents

why? 1) one machine cant handle infinite data so to horizontally scale → each query will be sent to all shards in parallel
2) parallelism, search at more shards at once to get results faster then re-rank them in the end to get top k results


mapping in ES: for each ES field, you define a mapping:-
1. type (text, keyword, integer, float, date, boolean
2. indexing behavior (searchable or not, tokenized or not)
3. search behavior (fuzzy, exact, sortable, aggregatable)

each mapping can be either:

  1. explicit mappping: you define your schema
  2. dynamic mapping: ES guesses your schema