Deprecated

Removal of mapping types

299 "[types removal] Specifying types in search requests is deprecated."

Specifying types in the search requests is deprecated in ES7.x and will remove in ES8.0.

All the query that using type will get the warning in the response's header. For example, employee is a type in the query below.

GET {{host}}/megacorp/employee/_search

References:

The query/filter merge

unknown query [filtered]

We will see the error above if we performed search by using the following query.

{
  "query": {
    "filtered": {
      "filter": {
        "range": {
          "age": {
            "gt": 30
          }
        }
      },
      "must": {
        "match": {
          "last_name": "smith"
        }
      }
    }
  }
}

should replaced with

{
  "query": {
    "bool": {
      "filter": {
        "range": {
          "age": {
            "gt": 30
          }
        }
      },
      "must": {
        "match": {
          "last_name": "smith"
        }
      }
    }
  }
}

References:

Text Field with fielddata

Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [interests] in order to load field data by uninverting the inverted index. Note that this can use significant memory.

Text fields is searchable by default but are not available for aggregations, sorting or scription. We will see the exception when execute the following query.

{
  "aggs": {
    "all_interests": {
      "terms": {
        "field": "interests"
      }
    }
  }
}

should replaced with

{
  "aggs": {
    "all_interests": {
      "terms": {
        "field": "interests.keyword"
      }
    }
  }
}

References:

Optimistic Concurrency Control

internal versioning can not be used for optimistic concurrency control

version cannot used for optimistic concurrency control anymore. To achieve that, we need to use if_primary_term and if_seq_no. The primary term _primary_term and sequence number _seq_no are uniquely identify a change. Primary term will be increase when a primary is promoted and sequence numbers will be increase and change when a operation is issued.

References:

File scripts

unknown field [params]

File scripts have been removed. We need to use stored scripts for that.

References:

The removal of the string type

Elasticsearch provided two ways to search for strings. You either can search for full match value(not_analyzed) or full-text search(analyzed). The analyzed string will replaced with text type and not_analyzed string will replaced with keyword type.

References:

_all field is deprecated

_all field is a special field that concatenate all the values in _source into one long string, so that we can search the values without knowing which field. However, it is too consume CPU and disk space.

References: