RousselTMLEARNING

TP · Elasticsearch: from discovery to expertise

Filter your documents

What you will learn in this TP
  • Filter with Lucene
  • Filter with KQL
  • Query a nested field
Mode :

All steps and instructions are shown. Recommended for this lab: semi-guided

Prerequisites #

Context. In Discover, you must find the right documents fast. You filter with Lucene syntax then with KQL, including on nested fields.

Prerequisites: an Elasticsearch cluster and Kibana (lab "Installing Elasticsearch"), Dev Tools  ·  Estimated time: 30 min

You need an Elasticsearch cluster with a Kibana instance connected to it. If that is not yet the case, we invite you to complete the lab on installing Elasticsearch.

Lucene #

  1. Search language

    In the 'Discover' application, how do you change the language used to filter results? What is the default language?

  2. My first filter

    In the 'mon-premier-index' index, display all documents whose message contains the word 'bulk'

  3. My second filter

    In the 'mon-premier-index' index, display all documents whose message contains exactly 'mon bulk', with an id between 2 and 4 and with an 'office' value of 'RousselTM' or 'Elastic'

  4. Did you notice?

    By default, Elasticsearch interpreted all of our JSON. In this exercise, let us assume we want it to keep the whole content of 'user' in the same field. What mapping would be needed for that? We will therefore create a new index named 'mon-second-index' with this mapping and re-import our bulk data to see the difference.

  5. Searching a 'nested' field

    Run the same search as before, but on 'mon-second-index'

Kibana Query Language #

  1. Good to know

    Everything you could do with Lucene filters is possible with KQL, and much more.

  2. My first filter

    In the 'mon-second-index' index, display all documents whose 'user.number' is greater than or equal to 2825

  3. Operations

    In the 'mon-second-index' index, display the average of 'user.number'

Validate your work

Check that each goal above is reached and that you get the result described in the introduction.

Difficulty level : ●●●○○ (3/5)

My progress

  • ⏱ Estimated time : ≈ 30 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Recent discussions about this course

Ask a question about this lesson →See all discussions about this course

Course Glossary

RBAC (Role-Based Access Control)

An access control method where permissions are assigned to specific roles (e.g., admin, reader) rather than directly to individual users.

Authentication

The process of verifying the identity of a user or system (e.g., login/password, tokens, biometrics).

Authorization

The process that occurs after authentication to determine if the entity has the necessary rights and privileges to access a resource.

API Key

A unique alphanumeric code used to identify, authenticate, and authorize access to an Application Programming Interface (API).

Architecture

The overall structural design of an IT system, defining its various components, their relationships, and the principles guiding its evolution.

Repository

A centralized storage location. This can refer to a source code repository (e.g., Git) or an artifact and binary repository (e.g., Harbor, Nexus, Arti...

Elasticsearch

A distributed, RESTful search and analytics engine capable of addressing a growing number of use cases, built on Apache Lucene.

Recommended Articles

Advanced Elasticsearch Query DSL and aggregations, with ES|QL

Write advanced Elasticsearch queries: bool, filter and score, nested, function_score and BM25 rel...

Advanced Kibana: data views, Lens, dashboards, alerting and reporting

Use Kibana in depth: data views and runtime fields, Discover, Lens and formulas, dashboards and c...

Vector search and RAG with Elasticsearch: dense_vector, kNN, hybrid search and RRF

Build semantic search with Elasticsearch: embeddings, the dense_vector field, kNN search, semanti...

Understanding the concept of score

The concept of score allows Elasticsearch to rank your documents by relevance during a search.

Automation and infrastructure as code for Elasticsearch: API, Terraform, Ansible and CI/CD

Automate Elasticsearch administration: REST API and clients, the elasticstack Terraform provider ...

Transforms and enrich: summarising and enriching data in Elasticsearch

Build entity-centric indices with pivot and latest transforms, and enrich documents at ingest tim...

Elasticsearch distributed architecture: node roles, shards, replicas and allocation

Understand how Elasticsearch works as a distributed system: node roles, master nodes and quorum, ...

Cross-cluster search and cross-cluster replication: multi-cluster Elasticsearch architectures

Design multi-cluster Elasticsearch architectures: remote clusters, cross-cluster search, cross-cl...

Elasticsearch ingestion: Bulk API, ingest pipelines, enrich and reindex

Ingest and transform data in Elasticsearch: Bulk API, ingest pipelines and processors (grok, diss...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!