-
Book Overview & Buying
-
Table Of Contents
Elasticsearch Query Language the Definitive Guide
By :
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_idgame_titlegenreplatformrelease_yeardeveloper_namepublisher_namegame_descriptionpurchase_dateprice_at_purchaseuser_ratingreview_dategame_keywordslegacy_scorecountry_codecontinentpurchase_devicepayment_methoddiscount_appliedThe 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:
Connect to Kibana and navigate to Machine Learning | Data Visualizer | File. You will see the following screen:
Click on the Select or drag and drop a file button and upload your file; you should see a summary similar to this:
After clicking on Import, set your index name. I chose retro_arcade_purchases_dataset:
You now have 500,000 records you can work with!A quick look in the Discover tab will show you all the data imported:
Change the font size
Change margin width
Change background colour