_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

Elasticsearch tutorial

01. 02. 2023 1 min read 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” } } } } }}

Key Takeaway

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

elasticsearchsearchdatabase
Share:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.