menu

Search By Label

In Elasticsearch, you store your data in indices, which are like containers for your information. Each index can have different kinds of data, like text, numbers, or dates.

Now, think of "mapping" as a set of rules that tells Elasticsearch what kind of data to expect in each index. It's like saying, "In this index, we have names, and they should be stored as text. In that index, we have numbers, and they should be treated as numbers."

So, when you request the _mapping, you're basically asking Elasticsearch to show you the rule book for each index. This rule book describes how data is organized and what type of data each field should contain.
A range filter in an Elasticsearch query is used to filter documents based on a specific numeric or date field falling within a specified range of values. This filter allows you to retrieve documents that meet certain criteria within a specified range.
 
When dealing with numeric fields (e.g., prices, quantities), you can use a range filter to find documents where the field value falls within a specified numeric range.

Example:

{ 
 "range": { 
   "price": { 
     "gte": 20, 
     "lte": 50 
   } 
 } 
} 
 
For date fields (e.g., timestamps, dates of events), you can use a range filter to filter documents within a specified date range.

Example:
{ 
 "range": { 
   "event_date": { 
     "gte": "2023-01-01", 
     "lte": "2023-12-31" 
   } 
 } 
}