From the course: Elasticsearch Essential Training
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Handling dates in Elasticsearch - Elastic Stack Tutorial
From the course: Elasticsearch Essential Training
Handling dates in Elasticsearch
- [Instructor] Assume that you are building a reporting dashboard and need to fetch orders from last 30 days, or maybe you wanted to show top selling product of this year. Handling dates is essential in Elasticsearch, whether you are dealing with the sales data, user activity, or the system log. Date is something an important attribute to take care of, so let's just see how we can play with the dates into an Elasticsearch. Let's just see our orders index. In that order index documents, you can find that we have a one attribute called order_date. Now, this attribute is having of type date. Now, imagine that you wanted to bring in all the orders which has been punched in last 30 days. Is it possible to do it? Yes. For that, we're going to use this specific query, which I have copied from the exercise file. In this query, you can see that I'm saying that find out all the orders which has the date greater than the last 30 days and less than equal to today's date. And let me execute this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Deep dive into Elasticsearch indices6m 31s
-
(Locked)
Mapping and data types5m 40s
-
(Locked)
Adding documents to Elasticsearch5m 25s
-
(Locked)
Updating documents11m 24s
-
(Locked)
Deleting the documents5m 55s
-
(Locked)
Retrieving the documents9m 11s
-
(Locked)
Handling dates in Elasticsearch5m 9s
-
(Locked)
-
-
-
-