Bulk Deleting Records in Elasticsearch

Introduction Having covered deleting records matching a query previously, let us now look at bulk delete using the id. Individual records can easily be deleted by specifying the id as follows. Here we are deleting the record with the id of 1835. curl -XDELETE "localhost:9200/globallandtemperatures_globaltemperatures.csv/doc/1835" This method does not, however, scale for deleting multiple records. …

Date histogram aggregation in Elasticsearch

Introduction Elasticsearch supports the histogram aggregation on date fields too, in addition to numeric fields. A date histogram shows the frequence of occurence of a specific date value within a dataset. For example, the following shows the distribution of all airplane crashes grouped by the year between 1980 and 2010. From the figure, you can …

Histogram aggregation in Elasticsearch

Introduction A histogram is a representation of numerical data grouped into contiguous groups based on the frequency of occurence. It is used to indicate the distribution of data. For example, height of subjects in a population is a continuous variable (meaning it can take all values within its range), and it can be grouped into …

Deleting an index and individual records in Elasticsearch

Introduction Elasticsearch provides REST API methods for deleting individual documents or an entire index. When deleting documents, you can specify the document by its ID to get rid of that particular document. You can also use a query to delete documents that match the query. In SQL, the first is equivalent to deleting a row …

Elasticsearch Date Range Query

Introduction In addition to numeric ranges, the range query also supports query results using a date range. You can specify date values for one or more conditions such as less than, less than or equal to, greater than and greater than or equal to a given value. The following is an example of a date-range …

Elasticsearch Numeric Range Query

Introduction A range query, as the name indicates, is used to search an integer or floating-point field for a range of values. These values are expressed as one or more conditions such as less than, less than or equal to, greater than or greater than or equal to a given value. Elasticsearch then locates the …

WHERE/IN query in Elasticsearch

Introduction People coming to Elasticsearch from the SQL world have questions regarding how to accomplish something in Elasticsearch that can be done by an SQL statement in a relational database. One such question is the WHERE/IN query. In the SQL world, this query looks like this: SELECT * FROM titles WHERE title IN ('Engineer', 'Senior …

Fuzzy Match in Elasticsearch

Introduction A fuzzy search refers to find matches to a pattern that match approximately according to some criteria. Elastic search supports fuzzy matching using an algorithm called Levenshtein edit distance. An edit distance is the total number of adds, deletes, replaces or transposes (a.k.a edits) required at each character of a pattern for it to …

Finding Unique Values in Elasticsearch

Introduction This document explains how to perform an elasticsearch query for the unique values of a field along with the counts. This is the equivalent of doing the following in SQL: the example below counts the unique values for the field title in the table titles. SELECT title, count(*) FROM Titles GROUP BY title Which …