Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Help Center/ Cloud Search Service/ Service Overview/ Differences Between Elasticsearch Cluster Versions

Differences Between Elasticsearch Cluster Versions

Updated on 2024-09-14 GMT+08:00
Table 1 Features of different Elasticsearch cluster versions

Version Feature

5. X Version

6. X Version

7. X Version

Supported types

An index can contain multiple types. The name of each type can be customized.

An index can contain only one type, and the type name can be customized.

An index can contain only one type. The type name and _doc are fixed.

Client access

TransportClient is supported. TCP and HTTP can be used for connection requests at the same time.

TransportClient is supported. TCP and HTTP can be used for connection requests at the same time. Java High Level REST Client is recommended.

Only RestClient is supported. Only HTTP can be used for connection requests. Java High Level REST Client is recommended.

The following is an example of using TransportClient to access an Elasticsearch cluster:

//Initialize the client and connect to port 9300.
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
        .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host1"), 9300))
        .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host2"), 9300));
//Close the client.
client.close();

The following is an example of using Java High Level REST Client to access a cluster:

//Initialize the client and connect to port 9200.
RestHighLevelClient client = new RestHighLevelClient(
        RestClient.builder(
                new HttpHost("localhost", 9200, "http"),
                new HttpHost("localhost", 9201, "http")));
//Close the client.
client.close();

Template configuration

The template field is used to create a template.

Example:

PUT _template/template_1
{
  "template": "te*",
  "settings": {
    "number_of_shards": 1
  }
}

The index_pattern field is used to create a template.

Example:

PUT _template/template_1
{
  "index_patterns": ["te*"],
  "settings": {
    "number_of_shards": 1
  }
}

Boolean type parsing

In Elasticsearch 5.x, true, false, on, off, yes, no, 0, and 1 can all be parsed as Boolean values.

Only true and false are supported. If other values are used, an error occurs.

Only in Elasticsearch 6.x or 7.x, errors will be reported for the following statements:

GET data1/_search
{
  "profile": "noprofile",
  "query": {
    "match_all": {}
  }
}

JSON format verification

Duplicate keys are allowed in JSON and will be automatically deleted in the background.

Duplicate keys are not allowed in JSON. Otherwise, a parsing error is reported.

Only in Elasticsearch 6.x or 7.x, errors will be reported for the following statements:

POST data1/doc
{
  "isl": 0,
  "isl": 1
}

DELETE document

If index1 does not exist and you run the DELETE index1/doc/1 command, the system will create index1.

If you run a command to delete an index that does not exist, an error message is displayed.

_alias API validation

The index field in the _alias API can be specified as an alias and can be parsed properly.

You can also use an alias to delete an index.

The index field in the _alias API can only be specified as an index name and cannot be an alias.

To delete an index, the index name is required.

The following command can run properly in Elasticsearch 5.x, but an error is reported when you run it in Elasticsearch 6.x or 7.x.

PUT log-2023.11.11
POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "log-2023.11.11",
        "alias": "log"
      }
    }
  ]
}
POST _aliases
{
  "actions": [
    {
      "remove": {
        "index": "log",
        "alias": "log"
      }
    }
  ]
}

Error message:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "The provided expression [log] matches an alias, specify the corresponding concrete indices instead."
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "The provided expression [log] matches an alias, specify the corresponding concrete indices instead."
  },
  "status" : 400
}

Default configurations

The default number of shards for a new index: 5

The default number of shards for a new index: 1

Default routing

In Elasticsearch 5.x/6.x, the following formula is used to calculate the shard where the document should be located:

shard_num = hash(_routing) % num_of_primary_shards

In Elasticsearch 7.x, the following formula is used to calculate the shard where the document should be located:

routing_factor = num_routing_shards / num_primary_shards 
shard_num = (hash(_routing) % num_routing_shards) / routing_factor

The following command can be used to specify the value of num_routing_shards:

index.number_of_routing_shards

If this parameter is not explicitly specified, Elasticsearch automatically calculates the value to split indexes.

Refresh time

By default, the refresh operation is performed every second.

If index.refresh_interval is not explicitly specified and indexes do not receive the search request for long time (the duration is specified by index.search.idle.after and the value is 30 seconds by default), Elasticsearch does not periodically refresh until when a new search request is received. In this case, search requests are not returned until the next refresh is complete. Therefore, the first search request takes a long time.

Parent fuse

The parent fuse is triggered when the sum of memory statistics in multiple child fuses exceeds the threshold. The default threshold is 70%.

The parent fuse is triggered when the heap memory usage exceeds the threshold. The default threshold is 95%.

Field Data fuse threshold

The default value of indices.breaker.fielddata.limit is 60%.

The default value of indices.breaker.fielddata.limit is 40%.

The _all field

Supported

Discarded

Deleted

hits.total returned by the search API

hits.total returned by the search API is a number, indicating the number of hits.

{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 4,
    "max_score": 1,
  }
}

hits.total is not a number.

{
  "took" : 76,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 4,
      "relation" : "eq"
    },
    "max_score" : 1.0
  }
}

In the preceding information:

value indicates the number of matched records.

relation indicates whether the number of hit records in the value parameter is accurate.

eq indicates an accurate value.

gte indicates that the number of hit records is greater than or equal to the value parameter.

_cache/clear API

The POST and GET methods are supported.

Only the POST method is supported.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback