Web Development · WDC-113

Elasticsearch with Python

Elasticsearch with Python is a course in using Elasticsearch 9 through the Python client, from managing documents and designing mappings and Thai analysers to searching with Query DSL, summarising data with aggregations and ES|QL, storing logs and running vector search. It suits Python developers, system administrators and DBAs who need fast search or log analytics.

Updated
From 11,250 THB / person 12,500 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration18 hours · 3 days
  • FormatOnsite / live online
  • Next roundOn request
  • CertificateIncluded

Course overview

Elasticsearch is a distributed search and analytics engine built on Apache Lucene. It powers search inside applications, log analytics and vector storage for AI work, while Kibana is used to explore and visualise the data. Both have moved on a long way in Elastic Stack 9, and version 9 of the Python client now ships the DSL module in the same package, so Python developers can build search and data work on Elasticsearch in one place.

This course takes learners through Elasticsearch 9 from Python, from installing it with Docker and managing documents with Python Client 9 to designing mappings and analysers, including Thai, searching with Query DSL, tuning results, and summarising data with aggregations and ES|QL. It continues with sending ECS-formatted logs from Python into data streams with ILM, exploring them in Kibana and running vector search, and closes with a workshop that builds a search API with FastAPI. (3 days, 6 hours per day, 18 hours in total, Intermediate level.)

What you’ll gain

  • Install Elasticsearch and Kibana 9 with Docker, with security and API keys
  • Manage indices and documents with Python Client 9, one at a time, in bulk and asynchronously
  • Design mappings and analysers that fit the data, including Thai text
  • Write Query DSL and Python DSL for term-level and full-text search and tune relevance
  • Summarise and analyse data with aggregations and ES|QL and bring the results into pandas
  • Write logs from Python to Elasticsearch in ECS format with data streams and ILM
  • Explore logs and build dashboards in Kibana
  • Run vector search and build a search API with FastAPI

Who this course is for

  • Python developers who want to add search or data analytics to their applications
  • System administrators who want to store and search application logs in Elasticsearch
  • Database administrators and data engineers who look after data in Elasticsearch
  • Teams that want to take their search systems further into semantic search

Prerequisites

  • Working knowledge of Python, such as functions, dictionaries and installing packages
  • Understanding of JSON and the idea of a REST API
  • Basic use of the command line and Docker
  • A laptop with 16 GB of RAM or more that can run Docker Desktop

Curriculum

Course Details

This course is the 2026 edition of Elasticsearch with Python, updated for Elastic Stack 9 and Python Client 9. It runs for 3 days, 6 hours per day (18 hours in total, 09:00-16:00), as lectures with labs built on one continuous dataset throughout. Intermediate level. Day one covers installation and managing data from Python, mappings and Thai analysers. Day two covers searching, tuning results,

aggregations and ES|QL. Day three covers logging from Python, data streams with ILM, Kibana and vector search, with a workshop that builds a search API with FastAPI. Every lab runs on the learner's own machine with Docker. The course focuses on Python; developers working in .NET have a separate Elasticsearch and Kibana with .NET course. Learners take home a lab guide, source code and docker-compose files.

Day 1 Elasticsearch 9 and Managing Data with Python

Section 1: Lab: Elastic Stack 9 and Installing with Docker

  • Elasticsearch use cases: in-app search, log analytics and vector search
  • Architecture: clusters, nodes, indices, shards, replicas and the inverted index
  • Install Elasticsearch and Kibana 9 with Docker with security enabled
  • Check cluster health and create an API key for a Python application
  • Lab: run your first commands in the Kibana Dev Tools Console

Section 2: Lab: Managing Documents with Python Client 9

  • Install Python Client 9 and connect with an API key
  • Create and delete indices, and index, get, replace and delete documents
  • Partial updates, scripted updates and upserts
  • Load large volumes of data with helpers.bulk and streaming_bulk
  • Use AsyncElasticsearch for workloads with many concurrent calls

Section 3: Reads, Writes and Concurrency

  • How Elasticsearch reads and writes data, routing and refresh
  • Document versioning and optimistic concurrency with if_seq_no
  • Update by query and delete by query
  • Lab: prevent lost updates when several programs write at the same time

Section 4: Lab: Designing Mappings

  • Dynamic versus explicit mapping, and combining the two
  • Core data types, text versus keyword fields, dates, arrays and type coercion
  • Multi-fields, field aliases, dynamic templates and index templates
  • Change mappings with the Reindex API, and an introduction to the Elastic Common Schema (ECS)
  • Lab: design mappings for product and article data

Section 5: Text Analysis and Thai

  • How analysers, tokenisers and token filters work
  • Test with the Analyze API and see the result in the inverted index
  • Stemming, stop words and built-in analysers
  • Segment Thai text with the Thai analyser and build custom analysers
  • Lab: compare Thai search results before and after tuning the analyser
Day 2 Searching and Analysing Data

Section 6: Lab: Term-Level Queries and the Python DSL

  • term, terms, ids and range queries
  • prefix, wildcard, regexp and exists queries
  • Write queries with the Search class in elasticsearch.dsl
  • Lab: search and filter products by category, price and status

Section 7: Full-Text Search and Relevance

  • match, multi_match and match_phrase
  • How BM25 scores documents and how to read the relevance score
  • bool queries: must, should, filter and must_not, with query and filter context
  • Tune ranking with boosting and dis_max
  • Lab: an article search that ranks results the way users expect

Section 8: Nested Objects and Joins

  • The problem with object arrays, and nested fields with inner hits
  • Parent and child join fields with has_child and has_parent
  • Terms lookup to pull conditions from another document
  • Performance limits, and when to denormalise instead

Section 9: Lab: Controlling and Improving Search Results

  • Source filtering, sorting and sorting on multi-valued fields
  • Paging with from and size, and deep paging with search_after and point in time
  • Fuzzy queries for typos, and proximity search
  • Synonyms and highlighting the matched terms
  • Lab: a typo-tolerant search box that highlights the search terms

Section 10: Lab: Aggregations and ES|QL

  • Metric aggregations and terms, range and histogram bucket aggregations
  • date_histogram, nested, filter and global aggregations
  • ES|QL basics: FROM, WHERE, STATS and SORT
  • Call ES|QL from Python and load the results into a pandas DataFrame
  • Lab: a monthly sales report by product category
Day 3 Logging, Kibana and Modern Search

Section 11: Lab: Writing Logs from Python to Elasticsearch

  • Why logs should be structured, and the ECS format
  • Configure Python logging with ecs-logging
  • Send logs to Elasticsearch in bulk and add request context
  • Lab: store a Python app's logs with a trace ID for troubleshooting

Section 12: Data Streams, ILM and Index Maintenance

  • Data streams for data that grows over time
  • Index templates and component templates
  • Index Lifecycle Management: rollover and automatic deletion of old data
  • Check index and shard sizes and cluster health
  • Lab: set a policy that keeps logs for 30 days and then deletes them

Section 13: Lab: Exploring and Visualising with Kibana

  • Data views and searching logs in Discover with KQL and ES|QL
  • Build visualisations with Lens
  • Combine them into a dashboard for monitoring an application
  • Lab: a dashboard of request counts, errors and response times

Section 14: Vector Search and Semantic Search

  • How keyword search differs from semantic search
  • Create embeddings in Python and store them in a dense_vector field
  • Run kNN search and combine it with ordinary filters
  • The semantic_text field and hybrid search (uses a trial licence)
  • Lab: search articles by the meaning of a Thai query

Section 15: Workshop: A Search API with FastAPI

  • Design a search API with FastAPI and AsyncElasticsearch
  • Endpoints for search, filtering, paging and query suggestions
  • Log the API to Elasticsearch and monitor it in Kibana
  • Present the work, review it together and wrap up with a pre-production checklist

Schedule & training options

For individuals — public rounds

No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

What is a mapping in Elasticsearch, and how do text and keyword fields differ?

A mapping defines an index's structure: what type each field is and how it is stored. A text field goes through an analyser that splits it into terms, which suits full-text search on names or descriptions. A keyword field stores the whole value as is, which suits exact filtering, sorting and aggregations on codes or categories. In practice a multi-field often gives one field both forms.

How do I add and search documents in Elasticsearch with Python?

Install version 9 of the elasticsearch package and create a client with your URL and API key. Call index to add one document at a time, or helpers.bulk for large volumes. To search, call search with Query DSL, or use the Search class in elasticsearch.dsl, which is part of the version 9 client. If your app makes many concurrent calls, for example on FastAPI, use AsyncElasticsearch.

What are aggregations in Elasticsearch used for?

Aggregations summarise large amounts of data in a single request, for example counts, sums and averages, or grouping by category, price range or time period. They drive reports, dashboards and facet filters on search pages. Elasticsearch also offers ES|QL, a readable piped query language that you can call from Python and load into pandas. The course practises both.

Who is Elasticsearch with Python for, and what background do I need?

It suits Python developers who want to add search or analytics to their apps, system administrators who store and search logs, and DBAs or data engineers who look after data in Elasticsearch. You should have working Python skills, understand JSON and REST APIs, and be comfortable with basic command line and Docker. Please bring a laptop with 16 GB of RAM or more that can run Docker Desktop.

What can I do after completing Elasticsearch with Python?

You will be able to install Elasticsearch 9 and connect to it from Python, design mappings and analysers that handle Thai, write queries and tune result ranking, summarise data with aggregations and ES|QL, write ECS-formatted logs from Python with data streams and ILM, build Kibana dashboards and run vector search. You also take home a FastAPI search API project to build on.

Can Elasticsearch with Python be run in-house for our team?

Yes. IT Genius Institute runs in-house training for organisations. Examples and labs can be adapted to your team's systems, such as product or Thai document search, or application log storage and search, and the emphasis can lean towards search or logging as needed. Contact the institute to request a quotation.

Related articles

Articles are published in Thai.