Přeskočit na obsah
_CORE
AI & Agentic Systems Core Informační Systémy Cloud & Platform Engineering Data Platforma & Integrace Security & Compliance QA, Testing & Observability IoT, Automatizace & Robotika Mobile & Digital Banky & Finance Pojišťovnictví Veřejná správa Obrana & Bezpečnost Zdravotnictví Energetika & Utility Telco & Média Průmysl & Výroba Logistika & E-commerce Retail & Loyalty
Reference Technologie Blog Knowledge Base O nás Spolupráce Kariéra
Pojďme to probrat

Elasticsearch tutorial

01. 01. 2024 1 min čtení intermediate

Elasticsearch je distribuovaný search engine. Full-text search, log analytics, real-time aggregations.

Indexing

Create index

PUT /products { “mappings”: { “properties”: { “name”: { “type”: “text”, “analyzer”: “czech” }, “price”: { “type”: “float” }, “category”: { “type”: “keyword” } }}}

Index document

POST /products/_doc

Full-text search

GET /products/_search { “query”: { “bool”: { “must”: [{ “match”: { “name”: “notebook” } }], “filter”: [ { “range”: { “price”: { “lte”: 30000 } } }, { “term”: { “category”: “electronics” } } ] } }}

Aggregations

GET /products/_search { “size”: 0, “aggs”: { “by_category”: { “terms”: { “field”: “category” }, “aggs”: { “avg_price”: { “avg”: { “field”: “price” } } } } }}

Klíčový takeaway

Elasticsearch pro full-text search a analytics. Keyword pro exact match, text pro full-text. Aggregations pro BI.

elasticsearchsearchdatabase