Latest in branch 5.1
5.1.2
Released 11 Jan 2017
(9 years ago)
SoftwareElasticsearch
Version5.1
Status
End of life
Initial release5.1.1
06 Dec 2016
(9 years ago)
Latest release5.1.2
11 Jan 2017
(9 years ago)
End of lifeUnavailable
Release noteshttps://www.elastic.co/guide/en/elasticsearch/reference/5.1/release-notes.html
Source codehttps://github.com/elastic/elasticsearch/tree/5.1
Documentationhttps://www.elastic.co/guide/en/elasticsearch/reference/5.1/
Downloadhttps://www.elastic.co/downloads/elasticsearch
Elasticsearch 5.1 ReleasesView full list

What Is New in Elasticsearch 5.1

Elasticsearch 5.1 delivers significant enhancements to the core engine, scripting, and data handling capabilities. This release focuses on performance, stability, and providing more powerful tools for developers. The key updates are summarized below.

Category Key Changes
New Features Painless Scripting Language, Reindex from Remote, Wait for Refresh API
Improvements Disk-based Shard Allocation, Internal Engine Optimizations, Date Histogram Aggregation
Bug Fixes Numerous fixes across aggregation, mapping, and node discovery
Deprecations Deprecated features in preparation for future removal

How does the new Painless scripting language improve performance?

Painless is a new secure, high-performance scripting language designed specifically for Elasticsearch. It executes significantly faster than previous options like Groovy, especially for complex scripts. This speed boost comes from its sandboxed design and just-in-time (JIT) compilation.

In practice, this means your aggregations and update-by-query operations that rely on inline scripting will run much faster. The syntax is also straightforward for Java developers, making it easier to write and maintain.

What is reindexing from a remote cluster and why is it useful?

The reindex-from-remote feature allows you to pull data from an older Elasticsearch cluster directly into a 5.1 cluster. This is a game-changer for migrations, as you no longer need to rely on external ETL tools to move your data between major versions.

You can use it by specifying a remote host in the reindex request body. This simplifies the upgrade path from versions like 2.x to 5.x dramatically, though network speed between clusters will be the limiting factor.

POST _reindex
{
  "source": {
    "remote": {
      "host": "http://old-cluster:9200"
    },
    "index": "old_index"
  },
  "dest": {
    "index": "new_index"
  }
}

How do the disk-based shard allocation controls help?

Elasticsearch 5.1 introduces finer-grained control over shard allocation based on disk usage. You can now set a high and low watermark for disk usage as a percentage of total disk space, not just as a fixed byte size.

This matters because it prevents nodes from running out of disk space, which can cause shard failures. The new percentage-based defaults are more adaptive to nodes with different disk sizes in the same cluster. You can configure this in your elasticsearch.yml.

What optimizations were made to the internal engine?

The internal engine saw major optimizations for indexing and recovery operations. Changes include better management of the version map and more efficient segment merging strategies.

These low-level improvements reduce heap memory usage during heavy indexing and speed up node recovery times. You'll likely see less garbage collection pressure and more stable performance during data ingestion spikes.

What's new with the Date Histogram aggregation?

The Date Histogram aggregation now supports returning empty buckets for intervals where no data exists. Previously, these gaps would be omitted from the response entirely.

This is crucial for generating complete time series charts in Kibana, as it ensures your graphs have a consistent timeline even with missing data points. You enable this by setting "min_doc_count": 0 in your aggregation query.

FAQ

Is Painless scripting backward compatible with my existing Groovy scripts?
No, Painless has its own syntax. You will need to rewrite your existing Groovy, Python, or JavaScript scripts to use the new Painless language. The effort is generally worth it for the performance and security gains.

Can I use reindex-from-remote to migrate from a very old version like 1.x?
The reindex-from-remote feature works with clusters running Elasticsearch 2.x and above. For migrating from 1.x, you would need to first upgrade to a 2.x version or use a different tool like Logstash.

Does the new disk allocation setting affect my existing cluster?
Yes, the new default watermarks (85% for high, 90% for low) are applied. If your nodes are already above these thresholds, shard allocation will be affected immediately. Review your disk usage before upgrading.

What happens to my stored Groovy scripts after upgrading to 5.1?
Stored scripts written in Groovy will need to be migrated to Painless. The Groovy language is deprecated and its sandboxing was removed, making it a potential security risk.

Are there any new settings I need to add to my configuration?
You should review the new disk allocation settings (cluster.routing.allocation.disk.watermark.low and ...high) and the new scripting settings. The upgrade guide provides a full list of breaking changes.

Releases In Branch 5.1

VersionRelease date
5.1.211 Jan 2017
(9 years ago)
5.1.106 Dec 2016
(9 years ago)