Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Elasticsearch Query Language the Definitive Guide
  • Table Of Contents Toc
Elasticsearch Query Language the Definitive Guide

Elasticsearch Query Language the Definitive Guide

By : Bahaaldine Azarmi, Stephen Brown, Farbod Shirzadian, Alejandro Sanchez, Alexis Charveriat
close
close
Elasticsearch Query Language the Definitive Guide

Elasticsearch Query Language the Definitive Guide

By: Bahaaldine Azarmi, Stephen Brown, Farbod Shirzadian, Alejandro Sanchez, Alexis Charveriat

Overview of this book

Built to simplify high-scale data analytics in Elasticsearch, this practical guide will take you from foundational concepts to advanced applications across search, observability, and security. It will help you overcome common challenges such as efficiently querying large datasets, applying advanced analytics without deep prior knowledge, and resolving for a unique and consolidated query language. Written by senior experts at Elastic with extensive field experience, this book delivers actionable guidance rooted in solving today’s data challenges at scale. After introducing ESQL and its architecture, the chapters explore real-world applications across various domains, including analytics, raw log analysis, observability, and cybersecurity. Advanced topics such as scaling, optimization, and future developments are also covered to help you maximize your ESQL capabilities. By the end of this book, you’ll be able to leverage ESQL for comprehensive data management and analysis, optimizing your workflows and enhancing your productivity with Elasticsearch.
Table of Contents (4 chapters)
close
close

Technical requirements

You can find all the code in this chapter in chapter1 of the GitHub repository for this book:https://github.com/PacktPublishing/Elasticsearch-Query-Language-the-Definitive-GuideThe dataset that we will use in this chapter for our examples is a synthetic dataset. We chose to build a retro arcade dataset that contains fictitious purchases of video games across the world in the 80s and 90s.We have created a notebook to generate this dataset. The script is called chapter1.ipynb and can be found in our GitHub repository: https://github.com/PacktPublishing/Elasticsearch-Query-Language-the-Definitive-Guide/blob/main/chapter1/chapter1.ipynb. You can customize it at your convenience.The script is fairly straightforward and builds a CSV file where each document has the description of a given video game purchase order:

  • purchase_id
  • game_title
  • genre
  • platform
  • release_year
  • developer_name
  • publisher_name
  • game_description
  • purchase_date
  • price_at_purchase
  • user_rating
  • review_date
  • game_keywords
  • legacy_score
  • country_code
  • continent
  • purchase_device
  • payment_method
  • discount_applied

The fields are self-explanatory and define what a purchase looked like in these years. With that in mind, here are the steps to import the data once you run the script and obtain a CSV file:

  1. Connect to Kibana and navigate to Machine Learning | Data Visualizer | File. You will see the following screen:

    Figure 1.1 – File upload
  2. Click on the Select or drag and drop a file button and upload your file; you should see a summary similar to this:

    Figure 1.2 – CSV file preview
  3. The file upload recognizes the CSV format and is ready to upload the content of your file to an index. You can overwrite the settings, but since we are all working out of the same script output, I recommend not changing anything.
  4. After clicking on Import, set your index name. I chose retro_arcade_purchases_dataset:

    Figure 1.3 – Import data final step
  5. The file upload will result in the following screen:
Figure 1.4 – File import summary

You now have 500,000 records you can work with!A quick look in the Discover tab will show you all the data imported:

Figure 1.5 – An overview of the imported data view in Discover
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Elasticsearch Query Language the Definitive Guide
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon