Elasticsearch 7.x版本重大改变(Breaking changes in 7.x)

Breaking changes in 7.0

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.0.
本部分讨论将应用程序迁移到Elasticsearch 7.0时需要注意的更改。

Indices created before 7.0

Elasticsearch 7.0 can read indices created in version 6.0 or above. An Elasticsearch 7.0 node will not start in the presence of indices created in a version of Elasticsearch before 6.0
Elasticsearch 7.0可以读取在6.0或更高版本中创建的索引。 如果存在在6.0之前的版本中创建的索引,则Elasticsearch 7.0节点将不会启动。

IMPORTANT

Reindex indices from Elasticsearch 5.x or before Indices created in Elasticsearch 5.x or before will need to be reindexed with Elasticsearch 6.x in order to be readable by Elasticsearch 7.x.
从Elasticsearch 5.x或更早版本重新索引索引 在Elasticsearch 5.x或更早版本中创建的索引将需要用Elasticsearch 6.x重新索引,以便Elasticsearch 7.x可以读取。

1.Aggregations changes

Deprecated global_ordinals_hash and global_ordinals_low_cardinality execution hints for terms aggregations have been removed

These execution_hint are removed and should be replaced by global_ordinals.

术语聚合已弃用的global_ordinals_hash和global_ordinals_low_cardinality执行提示已删除。
这些execution_hint被删除,应由global_ordinals代替

search.max_buckets in the cluster setting

The dynamic cluster setting named search.max_buckets now defaults to 10,000 (instead of unlimited in the previous version). Requests that try to return more than the limit will fail with an exception.

集群设置中的search.max_buckets
现在,名为search.max_buckets的动态集群设置默认为10,000(而不是先前版本中的无限制)。 尝试返回超过限制的请求将失败,并发生异常。

missing option of the composite aggregation has been removed

The missing option of the composite aggregation, deprecated in 6.x, has been removed. missing_bucket should be used instead.

复合聚合的缺少选项已被删除
6.x中不推荐使用的复合聚合缺少的选项已被删除。 应该使用missing_bucket代替。

Replaced params._agg with state context variable in scripted metric aggregations

The object used to share aggregation state between the scripts in a Scripted Metric Aggregation is now a variable called state available in the script context, rather than being provided via the params object as params._agg.

在脚本化的指标聚合中用状态上下文变量替换了params._agg
现在,用于在脚本化度量标准聚合中的脚本之间共享聚合状态的对象是在脚本上下文中可用的称为状态的变量,而不是通过params对象以params._agg的形式提供。

Make metric aggregation script parameters reduce_script and combine_script mandatory

The metric aggregation has been changed to require these two script parameters to ensure users are explicitly defining how their data is processed.

使度量标准聚合脚本参数reduce_script和Combine_script为必需
度量标准聚合已更改为需要这两个脚本参数,以确保用户明确定义如何处理其数据。

percentiles and percentile_ranks now return null instead of NaN

The percentiles and percentile_ranks aggregations used to return NaN in the response if they were applied to an empty set of values. Because NaN is not officially supported by JSON, it has been replaced with null.

percentiles和percentile_ranks现在返回null而不是NaN
如果将百分位数和percentile_ranks聚合应用于空值集,则它们将在响应中返回NaN。由于JSON尚未正式支持NaN,因此已将其替换为null。

stats and extended_stats now return 0 instead of null for zero docs

When the stats and extended_stats aggregations collected zero docs (doc_count: 0), their value would be null. This was in contrast with the sum aggregation which would return 0. The stats and extended_stats aggs are now consistent with sum and also return zero.

现在,stats和extended_stats对于零个文档返回0而不是null
当stats和extended_stats聚合收集了零个文档(doc_count:0)时,其值将为null。 这与求和聚合将返回0相反。stats和extended_stats aggs现在与sum一致,并且也返回零。

2.Cluster changes

: is no longer allowed in cluster name

Due to cross-cluster search using : to separate a cluster and index name, cluster names may no longer contain :.

是不在允许集群名字
由于使用:进行跨集群搜索以分隔集群和索引名称,因此集群名称可能不再包含:

New default for wait_for_active_shards parameter of the open index command

The default value for the wait_for_active_shards parameter of the open index API is changed from 0 to 1, which means that the command will now by default wait for all primary shards of the opened index to be allocated.

打开索引命令的wait_for_active_shards参数的新默认值
开放索引API的wait_for_active_shards参数的默认值从0更改为1,这意味着该命令现在默认情况下将等待分配开放索引的所有主分片。

Shard preferences _primary, _primary_first, _replica, and _replica_first are removed

These shard preferences are removed in favour of the _prefer_nodes and _only_nodes preferences.

碎片首选项_primary,_primary_first,_replica和_replica_first被删除
删除这些分片首选项,以支持_prefer_nodes和_only_nodes首选项。

Cluster-wide shard soft limit

Clusters now have soft limits on the total number of open shards in the cluster based on the number of nodes and the cluster.max_shards_per_node cluster setting, to prevent accidental operations that would destabilize the cluster. More information can be found in the documentation for that setting.

群集范围的分片软限制
现在,群集根据节点数和cluster.max_shards_per_node群集设置对群集中打开的分片总数进行了软限制,以防止意外操作会使群集不稳定。 在该设置的文档中可以找到更多信息。

3.Discovery changes

Cluster bootstrapping is required if discovery is configured

The first time a cluster is started, cluster.initial_master_nodes must be set to perform cluster bootstrapping. It should contain the names of the master-eligible nodes in the initial cluster and be defined on every master-eligible node in the cluster. See the discovery settings summary for an example, and the cluster bootstrapping reference documentation describes this setting in more detail.

The discovery.zen.minimum_master_nodes setting is permitted, but ignored, on 7.x nodes.

如果配置了发现,则需要集群引导
首次启动集群时,必须将cluster.initial_master_nodes设置为执行集群引导。 它应包含初始群集中符合主机要求的节点的名称,并应在群集中的每个符合主机要求的节点上进行定义。 有关示例,请参见发现设置摘要。集群自举参考文档更详细地描述了此设置。

在7.x节点上,discovery.zen.minimum_master_nodes设置是允许的,但被忽略。

Removing master-eligible nodes sometimes requires voting exclusions

If you wish to remove half or more of the master-eligible nodes from a cluster, you must first exclude the affected nodes from the voting configuration using the voting config exclusions API. If you remove fewer than half of the master-eligible nodes at the same time, voting exclusions are not required. If you remove only master-ineligible nodes such as data-only nodes or coordinating-only nodes, voting exclusions are not required. Likewise, if you add nodes to the cluster, voting exclusions are not required.

删除符合主机资格的节点有时需要排除投票
如果您希望从集群中删除一半或更多的符合Master要求的节点,则必须首先使用投票配置排除API将受影响的节点从投票配置中排除。 如果您同时删除少于一半的符合主机资格的节点,则不需要投票排除。 如果仅删除不符合主机要求的节点(例如仅数据节点或仅协调节点),则不需要投票排除。 同样,如果将节点添加到群集,则不需要投票排除。

Discovery configuration is required in production

Production deployments of Elasticsearch now require at least one of the following settings to be specified in the elasticsearch.yml configuration file:

  • discovery.seed_hosts
  • discovery.seed_providers
  • cluster.initial_master_nodes
  • discovery.zen.ping.unicast.hosts
  • discovery.zen.hosts_provider

The first three settings in this list are only available in versions 7.0 and above. If you are preparing to upgrade from an earlier version, you must set discovery.zen.ping.unicast.hosts or discovery.zen.hosts_provider.

生产中需要发现配置
现在,Elasticsearch的生产部署需要至少在Elasticsearch.yml配置文件中指定以下设置之一:

Discovery.seed_hosts
Discovery.seed_providers
cluster.initial_master_nodes
Discovery.zen.ping.unicast.hosts
Discovery.zen.hosts_provider
此列表中的前三个设置仅在7.0及更高版本中可用。 如果准备从早期版本升级,则必须设置discovery.zen.ping.unicast.hosts或discovery.zen.hosts_provider。

New name for no_master_block setting

The discovery.zen.no_master_block setting is now known as cluster.no_master_block. Any value set for discovery.zen.no_master_block is now ignored. You should remove this setting and, if needed, set cluster.no_master_block appropriately after the upgrade.

no_master_block设置的新名称
Discovery.zen.no_master_block设置现在称为cluster.no_master_block。 现在将忽略为Discovery.zen.no_master_block设置的任何值。 您应该删除此设置,并在需要后适当地设置cluster.no_master_block。

Reduced default timeouts for fault detection

By default the cluster fault detection subsystem now considers a node to be faulty if it fails to respond to 3 consecutive pings, each of which times out after 10 seconds. Thus a node that is unresponsive for longer than 30 seconds is liable to be removed from the cluster. Previously the default timeout for each ping was 30 seconds, so that an unresponsive node might be kept in the cluster for over 90 seconds.

减少故障检测的默认超时
默认情况下,如果群集节点未能响应3个连续的ping(每个ping在10秒后超时),则群集故障检测子系统现在将其视为故障节点。 因此,响应时间超过30秒的节点可能会从群集中删除。 以前,每个ping的默认超时为30秒,因此无响应的节点可能会在群集中保留90秒以上。

Master-ineligible nodes are ignored by discovery

In earlier versions it was possible to use master-ineligible nodes during the discovery process, either as seed nodes or to transfer discovery gossip indirectly between the master-eligible nodes. Clusters that relied on master-ineligible nodes like this were fragile and unable to automatically recover from some kinds of failure. Discovery now involves only the master-eligible nodes in the cluster so that it is not possible to rely on master-ineligible nodes like this. You should configure discovery.seed_hosts or another seed hosts provider to provide the addresses of all the master-eligible nodes in your cluster.

发现不考虑符合主机资格的节点
在早期版本中,可以在发现过程中使用不符合主机要求的节点作为种子节点,或者在符合条件的主机之间间接传输发现八卦。 像这样的依赖主机资格的节点的群集非常脆弱,无法自动从某些故障中恢复。 现在,发现仅涉及群集中符合主机要求的节点,因此不可能像这样依赖于符合主机要求的节点。 您应配置discovery.seed_hosts或其他种子主机提供程序,以提供集群中所有符合主机要求的节点的地址。

4.Indices changes

Index creation no longer defaults to five shards

Previous versions of Elasticsearch defaulted to creating five shards per index. Starting with 7.0.0, the default is now one shard per index.

索引创建不再默认为五个分片
Elasticsearch的早期版本默认为每个索引创建五个分片。 从7.0.0开始,默认值现在是每个索引一个分片。

: is no longer allowed in index name

Due to cross-cluster search using : to separate a cluster and index name, index names may no longer contain :.

index.unassigned.node_left.delayed_timeout may no longer be negative

Negative values were interpreted as zero in earlier versions but are no longer accepted.

index.unassigned.node_left.delayed_timeout可能不再为负
负值在早期版本中被解释为零,但不再被接受。

_flush and _force_merge will no longer refresh

In previous versions issuing a _flush or _force_merge (with flush=true) had the undocumented side-effect of refreshing the index which made new documents visible to searches and non-realtime GET operations. From now on these operations don’t have this side-effect anymore. To make documents visible an explicit _refresh call is needed unless the index is refreshed by the internal scheduler.

_flush和_force_merge将不再刷新
在以前的版本中,发出_flush或_force_merge(带有flush = true)具有刷新索引的未记录的副作用,该索引使新文档对搜索和非实时GET操作可见。 从现在开始,这些操作不再具有这种副作用。 为了使文档可见,除非内部调度程序刷新了索引,否则需要显式的_refresh调用。

Limit to the difference between max_size and min_size in NGramTokenFilter and NGramTokenizer

To safeguard against creating too many index terms, the difference between max_ngram and min_ngram in NGramTokenFilter and NGramTokenizer has been limited to 1. This default limit can be changed with the index setting index.max_ngram_diff. Note that if the limit is exceeded a error is thrown only for new indices. For existing pre-7.0 indices, a deprecation warning is logged.

限制NGramTokenFilter和NGramTokenizer中的max_size和min_size之差
为了防止创建过多的索引项,NGramTokenFilter和NGramTokenizer中的max_ngram和min_ngram之间的差异已限制为1。可以使用索引设置index.max_ngram_diff更改此默认限制。 请注意,如果超出限制,则仅对新索引抛出错误。 对于现有的7.0之前的索引,将记录弃用警告。

Document distribution changes

Indices created with version 7.0.0 onwards will have an automatic index.number_of_routing_shards value set. This might change how documents are distributed across shards depending on how many shards the index has. In order to maintain the exact same distribution as a pre 7.0.0 index, the index.number_of_routing_shards must be set to the index.number_of_shards at index creation time. Note: if the number of routing shards equals the number of shards _split operations are not supported.

文件分配变更
从7.0.0版开始创建的索引将设置自动index.number_of_routing_shards值。 这可能会改变文档在各个分片上的分配方式,具体取决于索引所包含的分片数。 为了保持与7.0.0之前的索引完全相同的分布,必须在创建索引时将index.number_of_routing_shards设置为index.number_of_shards。 注意:如果路由分片的数量等于分片的数量,则不支持_split操作。

Skipped background refresh on search idle shards

Shards belonging to an index that does not have an explicit index.refresh_interval configured will no longer refresh in the background once the shard becomes “search idle”, ie the shard hasn’t seen any search traffic for index.search.idle.after seconds (defaults to 30s). Searches that access a search idle shard will be “parked” until the next refresh happens. Indexing requests with wait_for_refresh will also trigger a background refresh.

搜索闲置碎片上的跳过背景刷新
一旦分片变为“搜索空闲”,即属于该分片的索引(未配置显式index.refresh_interval)将不再在后台刷新,即,几秒钟后该分片没有看到任何针对index.search.idle。的搜索流量。 (默认为30秒)。 访问搜索空闲分片的搜索将被“停放”,直到下一次刷新发生为止。 使用wait_for_refresh建立索引请求还将触发后台刷新。

Remove deprecated url parameters for Clear Indices Cache API

The following previously deprecated url parameter have been removed:

  • filter - use query instead
  • filter_cache - use query instead
  • request_cache - use request instead
  • field_data - use fielddata instead

删除Clear Indices Cache API弃用的url参数
以下先前不推荐使用的url参数已删除:

过滤器-使用查询代替
filter_cache-使用查询代替
request_cache-改用request
field_data-改用fielddata

network.breaker.inflight_requests.overhead` increased to 2

Previously the in flight requests circuit breaker considered only the raw byte representation. By bumping the value of network.breaker.inflight_requests.overhead from 1 to 2, this circuit breaker considers now also the memory overhead of representing the request as a structured object.

network.breaker.inflight_requests.overhead增加到2
以前,飞行中的请求断路器仅考虑原始字节表示。 通过将network.breaker.inflight_requests.overhead的值从1增加到2,此断路器现在还考虑了将请求表示为结构化对象的内存开销。

Parent circuit breaker changes

The parent circuit breaker defines a new setting indices.breaker.total.use_real_memory which is true by default. This means that the parent circuit breaker will trip based on currently used heap memory instead of only considering the reserved memory by child circuit breakers. When this setting is true, the default parent breaker limit also changes from 70% to 95% of the JVM heap size. The previous behavior can be restored by setting indices.breaker.total.use_real_memory to false.

父断路器的更改
父级断路器定义了一个新的设置index.breaker.total.use_real_memory,默认情况下为true。 这意味着父断路器将基于当前使用的堆内存而跳闸,而不是仅由子断路器考虑保留的内存。 当此设置为true时,默认的父断路器限制也将从JVM堆大小的70%更改为95%。 可以通过将index.breaker.total.use_real_memory设置为false来恢复以前的行为。

Field data circuit breaker changes

As doc values have been enabled by default in earlier versions of Elasticsearch, there is less need for fielddata. Therefore, the default value of the setting indices.breaker.fielddata.limit has been lowered from 60% to 40% of the JVM heap size.

现场数据断路器的变化
由于在早期版本的Elasticsearch中默认启用了doc值,因此对字段数据的需求减少了。 因此,设置索引index.breaker.fielddata.limit的默认值已从JVM堆大小的60%降低到40%。

fix value for index.shard.check_on_startup is removed

Deprecated option value fix for setting index.shard.check_on_startup is not supported.

index.shard.check_on_startup的固定值已删除
不支持用于设置index.shard.check_on_startup的选项值修复。

elasticsearch-translog is removed

Use the elasticsearch-shard tool to remove corrupted translog data.

elasticsearch-translog被删除
使用elasticsearch-shard工具删除损坏的转记录数据。

5.API changes

Ingest configuration exception information is now transmitted in metadata field

Previously, some ingest configuration exception information about ingest processors was sent to the client in the HTTP headers, which is inconsistent with how exceptions are conveyed in other parts of Elasticsearch.

Configuration exception information is now conveyed as a field in the response body.

现在,在元数据字段中传输摄取配置异常信息
以前,有关摄取处理器的一些摄取配置异常信息是通过HTTP标头发送到客户端的,这与Elasticsearch其他部分中传达异常的方式不一致。

现在,配置异常信息在响应正文中作为字段传达。

Ingest plugin special handling has been removed

There was some special handling for installing and removing the ingest-geoip and ingest-user-agent plugins after they were converted to modules. This special handling was done to minimize breaking users in a minor release, and would exit with a status code zero to avoid breaking automation.

This special handling has now been removed.

提取插件的特殊处理已删除
在将ingest-geoip和ingest-user-agent插件转换为模块后,需要进行一些特殊的安装和删除操作。 进行此特殊处理是为了最大程度地减少次要版本中破坏用户的情况,并以状态代码零退出以避免破坏自动化。

此特殊处理现已删除。

6.Mapping changes

The _all meta field is removed

The _all field deprecated in 6 have now been removed.

_all元字段已删除
现在已删除在6中弃用的_all字段。

The _uid meta field is removed

This field used to index a composite key formed of the _type and the _id. Now that indices cannot have multiple types, this has been removed in favour of _id.

_uid元字段已删除
该字段用于索引由_type和_id组成的复合键。 现在索引不能具有多个类型,因此已删除它,而使用_id。

The _default_ mapping is no longer allowed

The _default_ mapping has been deprecated in 6.0 and is now no longer allowed in 7.0. Trying to configure a _default_ mapping on 7.x indices will result in an error.

不再允许_default_映射
_default_映射在6.0中已弃用,现在在7.0中不再允许。 尝试在7.x索引上配置_default_映射将导致错误。

index_options for numeric fields has been removed

The index_options field for numeric fields has been deprecated in 6 and has now been removed.

数字字段的index_options已删除
数字字段的index_options字段已在6中弃用,现已删除。

Limiting the number of nested json objects

To safeguard against out of memory errors, the number of nested json objects within a single document across all fields has been limited to 10000. This default limit can be changed with the index setting index.mapping.nested_objects.limit.

限制嵌套json对象的数量
为了防止出现内存不足错误,单个文档中所有字段中嵌套json对象的数量限制为10000。可以使用索引设置index.mapping.nested_objects.limit更改此默认限制。

The update_all_types option has been removed

This option is useless now that all indices have at most one type.

update_all_types选项已被删除
由于所有索引最多具有一种类型,因此此选项无用。

The classic similarity has been removed

The classic similarity relied on coordination factors for scoring to be good in presence of stopwords in the query. This feature has been removed from Lucene, which means that the classic similarity now produces scores of lower quality. It is advised to switch to BM25 instead, which is widely accepted as a better alternative.

经典相似之处已删除
经典相似性依赖于协调因子,以便在查询中存在停用词时评分良好。 此功能已从Lucene中删除,这意味着经典的相似性现在会产生较低质量的分数。 建议改用BM25,它已被广泛认为是更好的选择。

Similarities fail when unsupported options are provided

An error will now be thrown when unknown configuration options are provided to similarities. Such unknown parameters were ignored before.

提供不支持的选项时相似性失败
如果为相似性提供未知的配置选项,现在将引发错误。 这样的未知参数之前被忽略。

Changed default geo_shape indexing strategy

geo_shape types now default to using a vector indexing approach based on Lucene’s new LatLonShape field type. This indexes shapes as a triangular mesh instead of decomposing them into individual grid cells. To index using legacy prefix trees the tree parameter must be explicitly set to one of quadtree or geohash. Note that these strategies are now deprecated and will be removed in a future version.

IMPORTANT NOTE: If using timed index creation from templates, the geo_shape mapping should also be changed in the template to explicitly define tree to one of geohash or quadtree. This will ensure compatibility with previously created indexes.

更改默认的geo_shape索引策略
现在,geo_shape类型默认使用基于Lucene的新LatLonShape字段类型的矢量索引方法。 这会将形状索引为三角形网格,而不是将其分解为单独的网格单元。 要使用旧式前缀树建立索引,必须将tree参数显式设置为四叉树或geohash之一。 请注意,这些策略现在已被弃用,并将在以后的版本中删除。

重要说明:如果使用通过模板创建定时索引,还应该在模板中更改geo_shape映射,以将树明确定义为geohash或quadtree之一。 这将确保与先前创建的索引兼容。

Deprecated geo_shape parameters

The following type parameters are deprecated for the geo_shape field type: tree, precision, tree_levels, distance_error_pct, points_only, and strategy. They will be removed in a future version.

不推荐使用的geo_shape参数
geo_shape字段类型不建议使用以下类型参数:tree,precision,tree_levels,distance_error_pct,points_only和strategy。 它们将在以后的版本中删除。

include_type_name now defaults to false

The default for include_type_name is now false for all APIs that accept the parameter.

include_type_name现在默认为false
现在,对于所有接受该参数的API,include_type_name的默认值为false。

7.ML changes

Types in Datafeed config are no longer valid

Types have been removed from the datafeed config and are no longer valid parameters.

数据Feed配置中的类型不再有效
类型已从数据Feed配置中删除,并且不再是有效参数。

堆外术语索引
术语词典是倒排索引的一部分,它按排序顺序记录段中出现的所有术语。为了提供快速检索,术语词典带有小的术语索引,该索引允许按术语进行有效的随机访问。到目前为止,此术语索引始终是堆加载的。

从7.0开始,术语索引将仅对具有唯一值的字段(如_id字段)进行堆加载,否则对其他字段(如大多数其他字段)进行堆外加载。预计这将减少内存需求,但如果同时满足以下两个条件,则可能会降低搜索请求的速度:

每个节点上的数据目录的大小明显大于文件系统缓存可用的内存量。
查询的匹配数不比查询尝试匹配的项数大几个数量级,无论是通过一项或多项查询来显式地,还是通过诸如前缀,通配符或模糊查询之类的多项查询来隐式地。
此更改会影响使用Elasticsearch 6.x创建的现有索引和使用Elasticsearch 7.x创建的新索引。

Changes to queries
  • The default value for transpositions parameter of fuzzy query has been changed to true.
  • The query_string options use_dismax, split_on_whitespace, all_fields, locale, auto_generate_phrase_query and lowercase_expanded_terms deprecated in 6.x have been removed.
  • Purely negative queries (only MUST_NOT clauses) now return a score of 0 rather than 1.
  • The boundary specified using geohashes in the geo_bounding_box query now include entire geohash cell, instead of just geohash center.
  • Attempts to generate multi-term phrase queries against non-text fields with a custom analyzer will now throw an exception.
  • An envelope crossing the dateline in a geo_shapequery is now processed correctly when specified using REST API instead of having its left and right corners flipped.
  • Attempts to set boost on inner span queries will now throw a parsing exception.

查询变更
模糊查询的转置参数的默认值已更改为true。
6.x中不建议使用的query_string选项use_dismax,split_on_whitespace,all_fields,区域设置,auto_generate_phrase_query和lowercase_expanded_terms已删除。
现在,纯否定查询(仅MUST_NOT子句)返回的分数为0而不是1。
现在,在geo_bounding_box查询中使用geohashhes指定的边界包括整个geohash单元,而不仅仅是geohash中心。
尝试使用自定义分析器针对非文本字段生成多词组查询现在将引发异常。
现在,使用REST API指定时,可以正确处理geo_shape查询中跨越日期线的信封,而不必左右翻转。
尝试对内部范围查询设置增强功能现在将引发解析异常。

Adaptive replica selection enabled by default

Adaptive replica selection has been enabled by default. If you wish to return to the older round robin of search requests, you can use the cluster.routing.use_adaptive_replica_selection setting:

默认情况下启用自适应副本选择
默认情况下已启用自适应副本选择。 如果希望返回到搜索请求的旧循环,可以使用cluster.routing.use_adaptive_replica_selection设置:

PUT /_cluster/settings
{
    "transient": {
        "cluster.routing.use_adaptive_replica_selection": false
    }
}
Search API returns 400 for invalid requests

The Search API returns 400 - Bad request while it would previously return 500 - Internal Server Error in the following cases of invalid request:

  • the result window is too large
  • sort is used in combination with rescore
  • the rescore window is too large
  • the number of slices is too large
  • keep alive for scroll is too large
  • number of filters in the adjacency matrix aggregation is too large
  • script compilation errors

Search API针对无效请求返回400
在以下无效请求的情况下,Search API返回400-错误的请求,而之前将返回500-内部服务器错误:

结果窗口太大
sort与rescore结合使用
重新评分窗口太大
切片数太大
为滚动太大而活跃
邻接矩阵聚合中的过滤器数量太大
脚本编译错误

Scroll queries cannot use the request_cache anymore

Setting request_cache:true on a query that creates a scroll (scroll=1m) has been deprecated in 6 and will now return a 400 - Bad request. Scroll queries are not meant to be cached.

滚动查询无法再使用request_cache
在创建滚动(scroll = 1m)的查询上设置request_cache:true已在6中被弃用,现在将返回400-错误的请求。 滚动查询并不意味着要被缓存。

Scroll queries cannot use rescore anymore

Including a rescore clause on a query that creates a scroll (scroll=1m) has been deprecated in 6.5 and will now return a 400 - Bad request. Allowing rescore on scroll queries would break the scroll sort. In the 6.x line, the rescore clause was silently ignored (for scroll queries), and it was allowed in the 5.x line.

滚动查询无法再使用重新评分
在6.5中已弃用在创建滚动(scroll = 1m)的查询上添加rescore子句,现在将返回400-错误的请求。 在滚动查询上允许重新评分会破坏滚动排序。 在6.x行中,rescore子句被静默忽略(用于滚动查询),并且在5.x行中被允许。

Term Suggesters supported distance algorithms

The following string distance algorithms were given additional names in 6.2 and their existing names were deprecated. The deprecated names have now been removed.

  • levenstein - replaced by levenshtein
  • jarowinkler - replaced by jaro_winkler

术语建议者支持的距离算法
以下字符串距离算法在6.2中被赋予了其他名称,并且不赞成使用它们的现有名称。 现在,已弃用的名称已被删除。

勒芬施泰因-被勒芬施泰因代替
jarowinkler-由jaro_winkler取代

popular mode for Suggesters

The popular mode for Suggesters (term and phrase) now uses the doc frequency (instead of the sum of the doc frequency) of the input terms to compute the frequency threshold for candidate suggestions.

建议者的流行模式
现在,建议者(术语和短语)的流行模式使用输入术语的doc频率(而不是doc频率的总和)来计算候选建议的频率阈值。

Limiting the number of terms that can be used in a Terms Query request

Executing a Terms Query with a lot of terms may degrade the cluster performance, as each additional term demands extra processing and memory. To safeguard against this, the maximum number of terms that can be used in a Terms Query request has been limited to 65536. This default maximum can be changed for a particular index with the index setting index.max_terms_count.

限制可以在术语查询请求中使用的术语数量
由于每个附加术语都需要额外的处理和内存,因此执行包含大量术语的术语查询可能会降低群集性能。 为了防止这种情况,在术语查询请求中可以使用的最大术语数已限制为65536。可以使用索引设置index.max_terms_count为特定索引更改此默认最大值。

Limiting the length of regex that can be used in a Regexp Query request

Executing a Regexp Query with a long regex string may degrade search performance. To safeguard against this, the maximum length of regex that can be used in a Regexp Query request has been limited to 1000. This default maximum can be changed for a particular index with the index setting index.max_regex_length.

限制可在Regexp查询请求中使用的正则表达式的长度
使用长的正则表达式字符串执行正则表达式查询可能会降低搜索性能。 为了防止这种情况,可在Regexp查询请求中使用的正则表达式的最大长度已限制为1000。可以使用索引设置index.max_regex_length更改特定索引的默认最大值。

Limiting the number of auto-expanded fields

Executing queries that use automatic expansion of fields (e.g. query_string, simple_query_string or multi_match) can have performance issues for indices with a large numbers of fields. To safeguard against this, a default limit of 1024 fields has been introduced for queries using the “all fields” mode ("default_field": "*") or other fieldname expansions (e.g. "foo*"). If needed, you can change this limit using the indices.query.bool.max_clause_count dynamic cluster setting.

限制自动扩展字段的数量
执行使用字段自动扩展的查询(例如query_string,simple_query_string或multi_match)可能会对具有大量字段的索引产生性能问题。 为了避免这种情况,已为使用“所有字段”模式(“ default_field”:“ *”)或其他字段名扩展(例如“ foo *”)的查询引入了默认的1024个字段限制。 如果需要,您可以使用index.query.bool.max_clause_count动态集群设置来更改此限制。

Invalid _search request body

Search requests with extra content after the main object will no longer be accepted by the _search endpoint. A parsing exception will be thrown instead.

无效的_search请求正文
_search端点将不再接受主对象之后具有更多内容的搜索请求。 相反,将引发解析异常。

Doc-value fields default format

The format of doc-value fields is changing to be the same as what could be obtained in 6.x with the special use_field_mapping format. This is mostly a change for date fields, which are now formatted based on the format that is configured in the mappings by default. This behavior can be changed by specifying a format within the doc-value field.

文档值字段的默认格式
文档值字段的格式正在更改,使其与在6.x中使用特殊的use_field_mapping格式可以获得的格式相同。 这主要是对日期字段的更改,它们现在根据默认情况下在映射中配置的格式进行格式化。 可以通过在doc-value字段中指定格式来更改此行为。

Context Completion Suggester

The ability to query and index context enabled suggestions without context, deprecated in 6.x, has been removed. Context enabled suggestion queries without contexts have to visit every suggestion, which degrades the search performance considerably.

For geo context the value of the path parameter is now validated against the mapping, and the context is only accepted if path points to a field with geo_point type.

上下文完成建议器
在6.x中已弃用的无上下文查询和索引上下文支持建议的功能已被删除。 没有上下文的启用了上下文的建议查询必须访问每个建议,这会大大降低搜索性能。

对于地理上下文,现在将根据映射验证path参数的值,并且仅当path指向具有geo_point类型的字段时才接受上下文。

Semantics changed for max_concurrent_shard_requests

max_concurrent_shard_requests used to limit the total number of concurrent shard requests a single high level search request can execute. In 7.0 this changed to be the max number of concurrent shard requests per node. The default is now 5.

max_concurrent_shard_requests的语义已更改
max_concurrent_shard_requests用于限制单个高级搜索请求可以执行的并发分片请求的总数。 在7.0版中,将其更改为每个节点的最大并发分片请求数。 现在的默认值为5。

max_score set to null when scores are not tracked

max_score used to be set to 0 whenever scores are not tracked. null is now used instead which is a more appropriate value for a scenario where scores are not available.

当不跟踪分数时,max_score设置为null
每当不跟踪分数时,max_score都设置为0。 现在使用null代替,对于没有分数的情况,这是一个更合适的值。

Negative boosts are not allowed

Setting a negative boost for a query or a field, deprecated in 6x, is not allowed in this version. To deboost a specific query or field you can use a boost comprise between 0 and 1.

不允许负升压
在此版本中,不允许为6x弃用的查询或字段设置负增强。 要提高特定查询或字段的效率,可以使用0到1之间的增强值。

Negative scores are not allowed in Function Score Query

Negative scores in the Function Score Query are deprecated in 6.x, and are not allowed in this version. If a negative score is produced as a result of computation (e.g. in script_score or field_value_factor functions), an error will be thrown.

功能分数查询中不允许出现负分数
在功能得分查询中,负得分在6.x中已弃用,并且在此版本中不允许使用。 如果计算结果产生负分数(例如在script_score或field_value_factor函数中),则会引发错误。

The filter context has been removed

The filter context has been removed from Elasticsearch’s query builders, the distinction between queries and filters is now decided in Lucene depending on whether queries need to access score or not. As a result bool queries with should clauses that don’t need to access the score will no longer set their minimum_should_match to 1. This behavior has been deprecated in the previous major version.

过滤器上下文已删除
过滤器上下文已从Elasticsearch的查询构建器中删除,查询和过滤器之间的区别现在在Lucene中根据查询是否需要访问得分来决定。 结果,对不需要访问分数的应该子句的布尔查询将不再将其minimum_should_match设置为1。在以前的主要版本中,该行为已被弃用。

hits.total is now an object in the search response

The total hits that match the search request is now returned as an object with a value and a relation. value indicates the number of hits that match and relation indicates whether the value is accurate (eq) or a lower bound (gte):

hits.total现在是搜索响应中的对象
现在,将与搜索请求匹配的总匹配作为具有值和关系的对象返回。 value表示匹配的命中数,relationship表示该值是准确(eq)还是下限(gte):

{
    "hits": {
        "total": {
            "value": 1000,
            "relation": "eq"
        },
        ...
    }
}

The total object in the response indicates that the query matches exactly 1000 documents (“eq”). The value is always accurate ("relation": "eq") when track_total_hits is set to true in the request. You can also retrieve hits.total as a number in the rest response by adding rest_total_hits_as_int=true in the request parameter of the search request. This parameter has been added to ease the transition to the new format and will be removed in the next major version (8.0).

响应中的总对象表示查询恰好匹配1000个文档(“ eq”)。 当在请求中将track_total_hits设置为true时,该值始终是准确的(“ relation”:“ eq”)。 您还可以通过在搜索请求的请求参数中添加rest_total_hits_as_int = true来在其余响应中将hits.total检索为数字。 已添加此参数以简化向新格式的过渡,并将在下一个主要版本(8.0)中将其删除。

hits.total is omitted in the response if track_total_hits is disabled (false)

If track_total_hits is set to false in the search request the search response will set hits.total to null and the object will not be displayed in the rest layer. You can add rest_total_hits_as_int=true in the search request parameters to get the old format back ("total": -1).

如果禁用track_total_hits,则在响应中省略hits.total(false)
如果在搜索请求中将track_total_hits设置为false,则搜索响应会将hits.total设置为null,并且该对象将不会显示在其余层中。 您可以在搜索请求参数中添加rest_total_hits_as_int = true,以恢复旧格式(“总计”:-1)。

track_total_hits defaults to 10,000

By default search request will count the total hits accurately up to 10,000 documents. If the total number of hits that match the query is greater than this value, the response will indicate that the returned value is a lower bound:

track_total_hits默认为10,000
默认情况下,搜索请求将准确地计算总点击数,最多10,000个文档。 如果与查询匹配的总点击数大于该值,则响应将指示返回的值是一个下限:

{
     "_shards": ...
     "timed_out": false,
     "took": 100,
     "hits": {
         "max_score": 1.0,
         "total" : {
             "value": 10000,    
             "relation": "gte"  
         },
         "hits": ...
     }
}

​ 1.There are at least 10000 documents that match the query

​ 2.This is a lower bound ("gte").

You can force the count to always be accurate by setting "track_total_hits to true explicitly in the search request.

Limitations on Similarities

Lucene 8 introduced more constraints on similarities, in particular:

  • scores must not be negative,
  • scores must not decrease when term freq increases,
  • scores must not increase when norm (interpreted as an unsigned long) increases.

相似性限制
Lucene 8引入了更多的相似性约束,特别是:

分数不能为负,
当词频增加时,分数不得降低,
规范(解释为无符号的长整数)增加时,分数不得增加。

Weights in Function Score must be positive

Negative weight parameters in the function_score are no longer allowed.

功能分数中的权重必须为正
function_score中的负权重参数不再允许。

Query string and Simple query string limit expansion of fields to 1024

The number of automatically expanded fields for the “all fields” mode ("default_field": "*") for the query_string and simple_query_string queries is now 1024 fields.

查询字符串和简单查询字符串将字段扩展限制为1024
现在,用于query_string和simple_query_string查询的“所有字段”模式(“ default_field”:“ *”)的自动扩展字段数为1024个字段。

8.Search and Query DSL changes

9.Suggesters changes

Registration of suggesters in plugins has changed

Plugins must now explicitly indicate the type of suggestion that they produce.

插件中建议者的注册已更改
现在,插件必须明确指出它们产生的建议的类型。

Phrase suggester now multiples alpha

Previously, the laplace smoothing used by the phrase suggester added alpha, when it should instead multiply. This behavior has been changed and will affect suggester scores.

词组提示器现在乘以alpha
以前,短语建议者使用的拉普拉斯平滑法在应该乘以的情况下添加了alpha。 此行为已更改,将影响建议者分数。

10.Packaging changes

systemd service file is no longer configuration

The systemd service file /usr/lib/systemd/system/elasticsearch.service was previously marked as a configuration file in rpm and deb packages. Overrides to the systemd elasticsearch service should be made in /etc/systemd/system/elasticsearch.service.d/override.conf.

systemd服务文件不再配置
先前已将系统服务文件/usr/lib/systemd/system/elasticsearch.service标记为rpm和deb软件包中的配置文件。 应该在/etc/systemd/system/elasticsearch.service.d/override.conf中进行对systemd elasticsearch服务的覆盖。

tar package no longer includes windows specific files

The tar package previously included files in the bin directory meant only for windows. These files have been removed. Use the zip package instead.

tar包不再包含Windows特定文件
tar包以前在bin目录中包含仅用于Windows的文件。 这些文件已被删除。 请改用zip包。

Ubuntu 14.04 is no longer supported

Ubuntu 14.04 will reach end-of-life on April 30, 2019. As such, we are no longer supporting Ubuntu 14.04.

不再支持Ubuntu 14.04
Ubuntu 14.04将于2019年4月30日终止使用。因此,我们不再支持Ubuntu 14.04。

CLI secret prompting is no longer supported

The ability to use ${prompt.secret} and ${prompt.text} to collect secrets from the CLI at server start is no longer supported. Secure settings have replaced the need for these prompts.

不再支持CLI秘密提示
不再支持使用$ {prompt.secret}和$ {prompt.text}在服务器启动时从CLI收集机密的功能。 安全设置已取代了对这些提示的需要。

11.Plugins changes

Azure Repository plugin
  • The legacy azure settings which where starting with cloud.azure.storage. prefix have been removed. This includes account, key, default and timeout. You need to use settings which are starting with azure.client. prefix instead.
  • Global timeout setting cloud.azure.storage.timeout has been removed. You must set it per azure client instead. Like azure.client.default.timeout: 10s for example.

See Azure Repository settings.

Azure存储库插件
旧的Azure设置从cloud.azure.storage开始。 前缀已被删除。 这包括帐户,密钥,默认值和超时。 您需要使用以azure.client开头的设置。 前缀代替。
全局超时设置cloud.azure.storage.timeout已删除。 您必须改为为每个Azure客户设置它。 例如azure.client.default.timeout:例如10s。
请参阅Azure存储库设置。

Google Cloud Storage Repository plugin
  • The repository settings application_name, connect_timeout and read_timeout have been removed and must now be specified in the client settings instead.

See Google Cloud Storage Client Settings.

Google Cloud Storage存储库插件
存储库设置application_name,connect_timeout和read_timeout已被删除,现在必须在客户端设置中指定。
请参阅Google Cloud Storage客户端设置。

S3 Repository Plugin
  • The plugin now uses the path style access pattern for all requests. In previous versions it was automatically determining whether to use virtual hosted style or path style access.

S3存储库插件
插件现在对所有请求使用路径样式访问模式。 在以前的版本中,它是自动确定是使用虚拟托管样式还是路径样式访问。

Analysis Plugin changes
  • The misspelled helper method requriesAnalysisSettings(AnalyzerProvider provider) has been renamed to requiresAnalysisSettings

分析插件更改
拼写错误的帮助器方法requriesAnalysisSettings(AnalyzerProvider provider)已重命名为requireAnalysisSettings

File-based discovery plugin
  • This plugin has been removed since its functionality is now part of Elasticsearch and requires no plugin. The location of the hosts file has moved from $ES_PATH_CONF/file-discovery/unicast_hosts.txt to $ES_PATH_CONF/unicast_hosts.txt. See the file-based hosts provider documentation for further information.
File-based discovery plugin
  • This plugin has been removed since its functionality is now part of Elasticsearch and requires no plugin. The location of the hosts file has moved from $ES_PATH_CONF/file-discovery/unicast_hosts.txt to $ES_PATH_CONF/unicast_hosts.txt. See the file-based hosts provider documentation for further information.

基于文件的发现插件
该插件已被删除,因为其功能现已成为Elasticsearch的一部分,并且不需要插件。 主机文件的位置已从$ ES_PATH_CONF / file-discovery / unicast_hosts.txt移至$ ES_PATH_CONF / unicast_hosts.txt。 有关更多信息,请参见基于文件的主机提供程序文档。

Security Extensions

As a consequence of the change to Realm settings, the getRealmSettings method has been removed from the SecurityExtension class, and the settings method on RealmConfig now returns the node’s (global) settings. Custom security extensions should register their settings by implementing the standard Plugin.getSettings method, and can retrieve them from RealmConfig.settings() or using one of the RealmConfig.getSetting methods. Each realm setting should be defined as an AffixSetting as shown in the example below:

Setting.AffixSetting<String> MY_SETTING = Setting.affixKeySetting(
  "xpack.security.authc.realms." + MY_REALM_TYPE + ".", "my_setting",
  key -> Setting.simpleString(key, properties)
);

The RealmSettings.simpleString method can be used as a convenience for the above.

安全扩展
由于更改了Realm设置,因此从SecurityExtension类中删除了getRealmSettings方法,并且RealmConfig上的settings方法现在返回节点的(全局)设置。 自定义安全扩展应该通过实现标准的Plugin.getSettings方法来注册其设置,并且可以从RealmConfig.settings()或使用RealmConfig.getSetting方法之一来检索它们。 每个领域设置都应定义为AffixSetting,如下例所示:

RealmSettings.simpleString方法可以方便地用于上述操作。

Tribe node removed

Tribe node functionality has been removed in favor of cross-cluster search.

部落节点已删除
部落节点功能已删除,有利于跨集群搜索。

Discovery implementations are no longer pluggable
  • The method DiscoveryPlugin#getDiscoveryTypes() was removed, so that plugins can no longer provide their own discovery implementations.

发现实施不再可插入
删除了DiscoveryPlugin#getDiscoveryTypes()方法,因此插件不再能够提供自己的发现实现。

Watcher hipchat action removed

Hipchat has been deprecated and shut down as a service. The hipchat action for watches has been removed.

观看者hipchat动作已删除
Hipchat已被弃用并作为服务关闭。 手表的hipchat动作已删除。

12.Analysis changes

13.API changes

Internal Versioning is no longer supported for optimistic concurrency control

Elasticsearch maintains a numeric version field for each document it stores. That field is incremented by one with every change to the document. Until 7.0.0 the API allowed using that field for optimistic concurrency control, i.e., making a write operation conditional on the current document version. Sadly, that approach is flawed because the value of the version doesn’t always uniquely represent a change to the document. If a primary fails while handling a write operation, it may expose a version that will then be reused by the new primary.

Due to that issue, internal versioning can no longer be used and is replaced by a new method based on sequence numbers. See Optimistic concurrency control for more details.

Note that the external versioning type is still fully supported.

内部版本控制不再支持乐观并发控制
Elasticsearch为其存储的每个文档维护一个数字版本字段。 每次对文档进行更改时,该字段都会增加一个。 在7.0.0之前,API允许使用该字段进行乐观并发控制,即以当前文档版本为条件进行写操作。 遗憾的是,这种方法存在缺陷,因为版本的价值并不总是唯一地代表对文档的更改。 如果主节点在执行写操作时失败,则它可能会公开一个版本,然后该版本将被新的主节点重用。

由于该问题,内部版本控制将不再使用,而是由基于序列号的新方法代替。 有关更多详细信息,请参见乐观并发控制。

请注意,仍然完全支持外部版本控制类型。

Camel case and underscore parameters deprecated in 6.x have been removed

A number of duplicate parameters deprecated in 6.x have been removed from Bulk request, Multi Get request, Term Vectors request, and More Like This Query requests.

The following camel case parameters have been removed:

  • opType
  • versionType, _versionType

The following parameters starting with underscore have been removed:

  • _parent
  • _retry_on_conflict
  • _routing
  • _version
  • _version_type

Instead of these removed parameters, use their non camel case equivalents without starting underscore, e.g. use version_type instead of _version_type or versionType.

6.x中不推荐使用的驼峰大小写和下划线参数已删除
从批量请求,多重获取请求,术语向量请求和类似查询中的更多请求中删除了6.x中不推荐使用的许多重复参数。

以下骆驼案例参数已被删除:

opType
versionType,_versionType
下划线开头的以下参数已被删除:

__parent
_retry_on_conflict
_routing
_version
_version_type
代替这些已删除的参数,使用它们的非驼峰大小写等效项而无需开始下划线,例如 使用version_type而不是_version_type或versionType。

Thread pool info

In previous versions of Elasticsearch, the thread pool info returned in the nodes info API returned min and max values reflecting the configured minimum and maximum number of threads that could be in each thread pool. The trouble with this representation is that it does not align with the configuration parameters used to configure thread pools. For scaling thread pools, the minimum number of threads is configured by a parameter called core and the maximum number of threads is configured by a parameter called max. For fixed thread pools, there is only one configuration parameter along these lines and that parameter is called size, reflecting the fixed number of threads in the pool. This discrepancy between the API and the configuration parameters has been rectified. Now, the API will report core and max for scaling thread pools, and size for fixed thread pools.

Similarly, in the cat thread pool API the existing size output has been renamed to pool_size which reflects the number of threads currently in the pool; the shortcut for this value has been changed from s to psz. The min output has been renamed to core with a shortcut of cr, the shortcut for max has been changed to mx, and the size output with a shortcut of sz has been reused to report the configured number of threads in the pool. This aligns the output of the API with the configuration values for thread pools. Note that core and max will be populated for scaling thread pools, and size will be populated for fixed thread pools.

线程池信息
在Elasticsearch的早期版本中,节点信息API中返回的线程池信息返回的最小值和最大值反映了每个线程池中配置的线程的最小和最大数量。这种表示形式的问题在于它与用于配置线程池的配置参数不一致。对于扩展线程池,最小线程数由称为core的参数配置,最大线程数由称为max的参数配置。对于固定线程池,这些行上只有一个配置参数,该参数称为大小,反映了池中固定数量的线程。 API和配置参数之间的差异已得到纠正。现在,API将报告用于扩展线程池的核心和最大值,以及用于固定线程池的大小。

同样,在cat线程池API中,现有的大小输出已重命名为pool_size,它反映了当前池中的线程数。此值的快捷方式已从s更改为psz。 min输出已使用cr的快捷方式重命名为core,max快捷方式已更改为mx,并且sz快捷方式的大小输出已重新用于报告池中已配置的线程数。这会将API的输出与线程池的配置值对齐。请注意,将为扩展线程池填充core和max,为固定线程池填充size和大小。

The parameter fields deprecated in 6.x has been removed from Bulk request

and Update request. The Update API returns 400 - Bad request if request contains unknown parameters (instead of ignored in the previous version).

6.x中弃用的参数字段已从批量请求中删除
和更新请求。 如果请求包含未知参数(而不是先前版本中的忽略参数),Update API将返回400-错误的请求。

PUT Document with Version error message changed when document is missing

If you attempt to PUT a document with versioning (e.g. PUT /test/_doc/1?version=4) but the document does not exist, a cryptic message is returned:

version conflict, current version [-1] is different than the one provided [4]

Now if the document is missing a more helpful message is returned:

document does not exist (expected version [4])

Although exceptions messages are liable to change and not generally subject to backwards compatibility, the nature of this message might mean clients are relying on parsing the version numbers and so the format change might impact some users.

缺少文档时更改带有版本的PUT文档错误消息
如果您尝试使用版本控制来放置文档(例如PUT / test / _doc / 1?version = 4),但是该文档不存在,则会返回一条隐秘消息:

现在,如果文档丢失,则会返回一条更有用的消息:

尽管例外消息很容易更改,并且通常不受向后兼容性的影响,但是此消息的性质可能意味着客户端依赖于解析版本号,因此格式更改可能会影响某些用户。

Remove support for suggest metric/index metric in indices stats and nodes stats APIs

Previously, suggest stats were folded into search stats. Support for the suggest metric on the indices stats and nodes stats APIs remained for backwards compatibility. Backwards support for the suggest metric was deprecated in 6.3.0 and now removed in 7.0.0.

In the past, fields could be provided either as a parameter, or as part of the request body. Specifying fields in the request body as opposed to a parameter was deprecated in 6.4.0, and is now unsupported in 7.0.0.

删除对索引统计信息和节点统计信息API中对建议指标/索引指标的支持
以前,将建议统计信息汇总到搜索统计信息中。 保留了对索引统计信息和节点统计信息API的建议指标的支持,以实现向后兼容。 对建议指标的向后支持在6.3.0中已弃用,现在在7.0.0中已删除。

过去,字段可以作为参数提供,也可以作为请求正文的一部分提供。 在6.4.0中已弃用了在请求正文中与参数相反的指定字段,而在7.0.0中则不再支持。

copy_settings is deprecated on shrink and split APIs

Versions of Elasticsearch prior to 6.4.0 did not copy index settings on shrink and split operations. Starting with Elasticsearch 7.0.0, the default behavior will be for such settings to be copied on such operations. To enable users in 6.4.0 to transition in 6.4.0 to the default behavior in 7.0.0, the copy_settings parameter was added on the REST layer. As this behavior will be the only behavior in 8.0.0, this parameter is deprecated in 7.0.0 for removal in 8.0.0.

在缩小和拆分API上已弃用copy_settings
6.4.0之前的Elasticsearch版本未在收缩和拆分操作中复制索引设置。 从Elasticsearch 7.0.0开始,默认行为是在此类操作中复制此类设置。 为了使6.4.0中的用户能够从6.4.0中过渡到7.0.0中的默认行为,在REST层上添加了copy_settings参数。 由于此行为将是8.0.0中的唯一行为,因此在7.0.0中不建议使用此参数,而在8.0.0中将其删除。

The deprecated stored script contexts have now been removed

When putting stored scripts, support for storing them with the deprecated template context or without a context is now removed. Scripts must be stored using the script context as mentioned in the documentation.

已弃用的存储脚本上下文现已删除
放置存储的脚本时,现在不再支持使用已弃用的模板上下文或不使用上下文存储它们。 必须使用文档中提到的脚本上下文来存储脚本。

Removed Get Aliases API limitations when security features are enabled

The behavior and response codes of the get aliases API no longer vary depending on whether security features are enabled. Previously a 404 - NOT FOUND (IndexNotFoundException) could be returned in case the current user was not authorized for any alias. An empty response with status 200 - OK is now returned instead at all times.

启用安全功能后,删除了“获取别名” API的限制
获取别名API的行为和响应代码不再取决于是否启用了安全功能而有所不同。 如果当前用户未获得任何别名的授权,则以前可能会返回404-NOT FOUND(IndexNotFoundException)。 现在将始终返回状态为200-OK的空响应。

Put User API response no longer has user object

The Put User API response was changed in 6.5.0 to add the created field outside of the user object where it previously had been. In 7.0.0 the user object has been removed in favor of the top level created field.

放置用户API响应不再具有用户对象
Put User API响应在6.5.0中进行了更改,以将创建的字段添加到用户对象之前所在的位置之外。 在7.0.0版中,已删除用户对象,而改用了顶级创建字段。

Source filtering url parameters _source_include and _source_exclude have been removed

The deprecated in 6.x url parameters are now removed. Use _source_includes and _source_excludes instead.

源过滤网址参数_source_include和_source_exclude已删除
现在已删除在6.x url参数中弃用的内容。 请改用_source_includes和_source_excludes。

Multi Search Request metadata validation

MultiSearchRequests issued through _msearch now validate all keys in the metadata section. Previously unknown keys were ignored while now an exception is thrown.

多搜索请求元数据验证
现在,通过_msearch发出的MultiSearchRequests可以验证元数据部分中的所有键。 以前未知的键被忽略,而现在引发异常。

Deprecated graph endpoints removed

The deprecated graph endpoints (those with /_graph/_explore) have been removed.

弃用的图端点
不推荐使用的图形端点(带有/ _graph / _explore的图形端点)已被删除。

Deprecated _termvector endpoint removed

The _termvector endpoint was deprecated in 2.0 and has now been removed. The endpoint _termvectors (plural) should be used instead.

弃用的_termvector端点已删除
_termvector端点在2.0中已弃用,现已删除。 应改为使用端点_termvectors(复数)。

When security features are enabled, index monitoring APIs over restricted indices are not authorized implicitly anymore

Restricted indices (currently only .security-6 and .security) are special internal indices that require setting the allow_restricted_indices flag on every index permission that covers them. If this flag is false (default) the permission will not cover these and actions against them will not be authorized. However, the monitoring APIs were the only exception to this rule. This exception has been forfeited and index monitoring privileges have to be granted explicitly, using the allow_restricted_indices flag on the permission (as any other index privilege).

启用安全功能后,不再隐式授权对受限索引的索引监视API
受限索引(当前仅.security-6和.security)是特殊的内部索引,要求对覆盖它们的每个索引权限都设置allow_restricted_indices标志。 如果此标志为false(默认值),则权限将不覆盖这些权限,并且将不授权对其进行操作。 但是,监视API是该规则的唯一例外。 此异常已被取消,必须使用权限上的allow_restricted_indices标志(与任何其他索引特权一样)显式授予索引监视特权。

Removed support for GET on the _cache/clear API

The _cache/clear API no longer supports the GET HTTP verb. It must be called with POST.

删除了_cache / clear API对GET的支持
_cache / clear API不再支持GET HTTP动词。 必须使用POST调用它。

Cluster state size metrics removed from Cluster State API Response

The compressed_size / compressed_size_in_bytes fields were removed from the Cluster State API response. The calculation of the size was expensive and had dubious value, so the field was removed from the response.

从集群状态API响应中删除了集群状态大小指标
从Cluster State API响应中删除了compressed_size / compressed_size_in_bytes字段。 大小的计算非常昂贵且价值可疑,因此从响应中删除了该字段。

Migration Assistance API has been removed

The Migration Assistance API has been functionally replaced by the Deprecation Info API, and the Migration Upgrade API is not used for the transition from ES 6.x to 7.x, and does not need to be kept around to repair indices that were not properly upgraded before upgrading the cluster, as was the case in 6.

迁移协助API已被删除
迁移协助API已在功能上被“弃用信息” API取代,并且“迁移升级API”不用于从ES 6.x到7.x的过渡,不需要保留它来修复不正确的索引。 在升级集群之前先进行升级,如6。

Changes to thread pool naming in Node and Cat APIs

The thread_pool information returned from the Nodes and Cat APIs has been standardized to use the same terminology as the thread pool configurations. This means the response will align with the configuration instead of being the same across all the thread pools, regardless of type.

对Node和Cat API中的线程池命名的更改
从Nodes和Cat API返回的thread_pool信息已经标准化,可以使用与线程池配置相同的术语。 这意味着响应将与配置一致,而不是在所有线程池中都相同,无论类型如何。

Return 200 when cluster has valid read-only blocks

If the cluster was configured with no_master_block: write and lost its master, it would return a 503 status code from a main request (GET /) even though there are viable read-only nodes available. The cluster now returns 200 status in this situation.

当集群具有有效的只读块时返回200
如果集群配置了no_master_block:并丢失了其主服务器,则即使有可用的只读节点,它也会从主请求(GET /)中返回503状态代码。 现在,在这种情况下,群集将返回200状态。

Clearing indices cache is now POST-only

Clearing the cache indices could previously be done via GET and POST. As GET should only support read only non state-changing operations, this is no longer allowed. Only POST can be used to clear the cache.

清除索引缓存现在仅用于POST
清除缓存索引以前可以通过GET和POST完成。 由于GET应该只支持只读的非状态更改操作,因此不再允许这样做。 仅POST可以用于清除缓存。

14.Java API changes

isShardsAcked deprecated in 6.2 has been removed

isShardsAcked has been replaced by isShardsAcknowledged in CreateIndexResponse, RolloverResponse and CreateIndexClusterStateUpdateResponse.

6.2中弃用的isShardsAcked已被删除
在CreateIndexResponse,RolloverResponse和CreateIndexClusterStateUpdateResponse中,isShardsAcked已替换为isShardsAcknowledged。

prepareExecute removed from the client api

The prepareExecute method which created a request builder has been removed from the client api. Instead, construct a builder for the appropriate request directly.

从客户端api中删除了prepareExecute
创建请求构建器的prepareExecute方法已从客户端api中删除。 而是直接为适当的请求构造一个构建器。

Some Aggregation classes have moved packages
  • All classes present in org.elasticsearch.search.aggregations.metrics.* packages were moved to a single org.elasticsearch.search.aggregations.metrics package.
  • All classes present in org.elasticsearch.search.aggregations.pipeline.* packages were moved to a single org.elasticsearch.search.aggregations.pipeline package. In addition, org.elasticsearch.search.aggregations.pipeline.PipelineAggregationBuilders was moved to org.elasticsearch.search.aggregations.PipelineAggregationBuilders

一些聚合类已移动软件包
org.elasticsearch.search.aggregations.metrics。*包中存在的所有类都移到了一个org.elasticsearch.search.aggregations.metrics包中。
org.elasticsearch.search.aggregations.pipeline。*包中存在的所有类都移到了一个org.elasticsearch.search.aggregations.pipeline包中。 此外,org.elasticsearch.search.aggregations.pipeline.PipelineAggregationBuilders已移至org.elasticsearch.search.aggregations.PipelineAggregationBuilders

Retry.withBackoff methods with Settings removed

The variants of Retry.withBackoff that included Settings have been removed because Settings is no longer needed.

Retry.withBackoff方法已删除设置
Retry.withBackoff包含设置的变体已被删除,因为不再需要设置。

Deprecated method Client#termVector removed

The client method termVector, deprecated in 2.0, has been removed. The method termVectors (plural) should be used instead.

弃用的方法Client#termVector已删除
在2.0中弃用的客户端方法termVector已被删除。 应该使用方法termVectors(复数)代替。

弃用的构造函数AbstractLifecycleComponent(设置设置)已删除
6.7中弃用的构造函数AbstractLifecycleComponent(Settings settings)已被删除。 应改用无参数构造函数。

15.Settings changes

The default for node.name is now the hostname

node.name now defaults to the hostname at the time when Elasticsearch is started. Previously the default node name was the first eight characters of the node id. It can still be configured explicitly in elasticsearch.yml.

现在,node.name的默认值为主机名
现在,当Elasticsearch启动时,node.name默认为主机名。 以前,默认节点名称是节点ID的前八个字符。 仍然可以在elasticsearch.yml中显式配置它。

Percolator
  • The deprecated index.percolator.map_unmapped_fields_as_string setting has been removed in favour of the index.percolator.map_unmapped_fields_as_text setting.

渗滤器
为了支持index.percolator.map_unmapped_fields_as_text设置,已删除了不推荐使用的index.percolator.map_unmapped_fields_as_string设置。

Index thread pool
  • Internally, single-document index/delete/update requests are executed as bulk requests with a single-document payload. This means that these requests are executed on the bulk thread pool. As such, the indexing thread pool is no longer needed and has been removed. As such, the settings thread_pool.index.size and thread_pool.index.queue_size have been removed.

索引线程池
在内部,单文档索引/删除/更新请求作为具有单文档有效负载的批量请求执行。 这意味着这些请求在批量线程池上执行。 因此,不再需要索引线程池,并且已将其删除。 因此,已删除设置thread_pool.index.size和thread_pool.index.queue_size。

Write thread pool fallback
  • The bulk thread pool was replaced by the write thread pool in 6.3.0. However, for backwards compatibility reasons the name bulk was still usable as fallback settings thread_pool.bulk.size and thread_pool.bulk.queue_size for thread_pool.write.size and thread_pool.write.queue_size, respectively, and the system property es.thread_pool.write.use_bulk_as_display_name was available to keep the display output in APIs as bulk instead of write. These fallback settings and this system property have been removed.

写线程池回退
在6.3.0中,批量线程池被写线程池替换。 但是,出于向后兼容的原因,名称bulk仍可分别用作thread_pool.write.size和thread_pool.write.queue_size的后备设置thread_pool.bulk.size和thread_pool.bulk.queue_size以及系统属性es.thread_pool.write .use_bulk_as_display_name可用于将显示输出保留在API中,而不是写入。 这些后备设置和此系统属性已被删除。

Disabling memory-mapping
  • The setting node.store.allow_mmapfs has been renamed to node.store.allow_mmap.

禁用内存映射
设置node.store.allow_mmapfs已重命名为node.store.allow_mmap。

Http enabled setting removed
  • The setting http.enabled previously allowed disabling binding to HTTP, only allowing use of the transport client. This setting has been removed, as the transport client will be removed in the future, thus requiring HTTP to always be enabled.

Http启用设置已删除
之前的设置http.enabled允许禁用与HTTP的绑定,仅允许使用传输客户端。 此设置已被删除,因为将来会删除传输客户端,因此要求始终启用HTTP。

Http pipelining setting removed
  • The setting http.pipelining previously allowed disabling HTTP pipelining support. This setting has been removed, as disabling http pipelining support on the server provided little value. The setting http.pipelining.max_events can still be used to limit the number of pipelined requests in-flight.

HTTP流水线设置已删除
设置http.pipelining以前允许禁用HTTP管道支持。 此设置已删除,因为在服务器上禁用http管道支持几乎没有价值。 设置http.pipelining.max_events仍可用于限制进行中的流水线请求数。

Cross-cluster search settings renamed

The cross-cluster search remote cluster connection infrastructure is also used in cross-cluster replication. This means that the setting names search.remote.* used for configuring cross-cluster search belie the fact that they also apply to other situations where a connection to a remote cluster as used. Therefore, these settings have been renamed from search.remote.* to cluster.remote.*. For backwards compatibility purposes, we will fallback to search.remote.* if cluster.remote.* is not set. For any such settings stored in the cluster state, or set on dynamic settings updates, we will automatically upgrade the setting from search.remote.* to cluster.remote.*. The fallback settings will be removed in 8.0.0.

跨集群搜索设置已重命名
跨集群搜索远程集群连接基础结构也用于跨集群复制。 这意味着用于配置跨集群搜索的设置名称search.remote。掩盖了以下事实:它们也适用于使用远程集群的其他情况。 因此,这些设置已从search.remote。重命名为cluster.remote。。 为了向后兼容,如果未设置cluster.remote。,我们将回退到search.remote。*。 对于存储在集群状态中或在动态设置更新中设置的任何此类设置,我们将自动将设置从search.remote。升级到cluster.remote。。 后备设置将在8.0.0中删除。

Audit logfile local node info

The following settings have been removed:

  • xpack.security.audit.logfile.prefix.emit_node_host_address, instead use xpack.security.audit.logfile.emit_node_host_address
  • xpack.security.audit.logfile.prefix.emit_node_host_name, instead use xpack.security.audit.logfile.emit_node_host_name
  • xpack.security.audit.logfile.prefix.emit_node_name, instead use xpack.security.audit.logfile.emit_node_name

The new settings have the same meaning as the removed ones, but the prefix name component is no longer meaningful as logfile audit entries are structured JSON documents and are not prefixed by anything. Moreover, xpack.security.audit.logfile.emit_node_name has changed its default from true to false. All other settings mentioned before, have kept their default value of false.

审核日志文件本地节点信息
以下设置已被删除:

xpack.security.audit.logfile.prefix.emit_node_host_address,而不要使用xpack.security.audit.logfile.emit_node_host_address
xpack.security.audit.logfile.prefix.emit_node_host_name,而不要使用xpack.security.audit.logfile.emit_node_host_name
xpack.security.audit.logfile.prefix.emit_node_name,请改用xpack.security.audit.logfile.emit_node_name
新设置与已删除的设置具有相同的含义,但是前缀名称组件不再有意义,因为日志文件审核条目是结构化的JSON文档,并且没有任何前缀。 此外,xpack.security.audit.logfile.emit_node_name的默认值已从true更改为false。 前面提到的所有其他设置都保留其默认值false。

Security realms settings

The settings for all security realms must now include the realm type as part of the setting name, and the explicit type setting has been removed.

A realm that was previous configured as:

xpack.security.authc.realms:
  ldap1:
    type: ldap
    order: 1
    url: "ldaps://ldap.example.com/"

Must be migrated to:

xpack.security.authc.realms:
  ldap.ldap1:
    order: 1
    url: "ldaps://ldap.example.com/"

Any realm specific secure settings that have been stored in the elasticsearch keystore (such as ldap bind passwords, or passwords for ssl keys) must be updated in a similar way.

安全领域设置

现在,所有安全领域的设置都必须包括领域类型作为设置名称的一部分,并且显式的“类型”设置已被删除。

先前配置为的领域:

必须迁移到:

TLS/SSL settings

The default TLS/SSL settings, which were prefixed by xpack.ssl, have been removed. The removal of these default settings also removes the ability for a component to fallback to a default configuration when using TLS. Each component (realm, transport, http, http client, etc) must now be configured with their own settings for TLS if it is being used.

TLS / SSL设置
xpack.ssl前缀的默认TLS / SSL设置已被删除。 删除这些默认设置也会使组件在使用TLS时回退到默认配置的能力。 如果正在使用TLS,则必须为每个组件(领域,传输,http,http客户端等)配置它们自己的TLS设置。

TLS v1.0 disabled

TLS version 1.0 is now disabled by default as it suffers from known security issues. The default protocols are now TLSv1.3 (if supported), TLSv1.2 and TLSv1.1.

You can enable TLS v1.0 by configuring the relevant ssl.supported_protocols setting to include "TLSv1". Depending on your local configuration and the TLS protocols that are in use on your network, you may need to enable TLS v1.0 support in any or all of the following places:

  • xpack.security.http.ssl.supported_protocols

    For incoming HTTP connections to Elasticsearch’s HTTP (Rest) interface. If there are clients that connect to Elasticsearch and do not support newer TLS versions, you must update this setting.

  • xpack.http.ssl.supported_protocols

    For outgoing HTTP connections from Watcher. If you have watches that connect to external HTTP servers and do not support newer TLS versions, you must update this setting.

  • xpack.security.authc.realms.ldap.{name}.ssl.supported_protocols

    For outgoing LDAP connections from Elasticsearch security features. If you have an LDAP realm enabled and the LDAP directory to which that realm connects does not support newer TLS versions, you must update this setting.

  • xpack.security.authc.realms.active_directory.{name}.ssl.supported_protocols

    For outgoing Active Directory (LDAP) connections from Elasticsearch security features. If you have an AD realm enabled and the directory server to which that realm connects does not support newer TLS versions, you must update this setting.

  • xpack.security.authc.realms.saml.{name}.ssl.supported_protocols

    For outgoing HTTP connections to retrieve SAML metadata. If you have a SAML realm enabled and the realm is configured to retrieve metadata over HTTPS (that is, idp.metadata.path is a URL starting with https://) and the web server which hosts the metadata does not support newer TLS versions, you must update this setting.

  • xpack.security.authc.realms.oidc.{name}.ssl.supported_protocols

    For outgoing HTTP connections to an OpenId Connect Provider. If you have an OpenId Connect (“oidc”) realm enabled and the realm is configured to connect to a remote OpenID Connect Provider which does not support newer TLS versions, you must update this setting.

  • xpack.monitoring.exporters.{name}.ssl.supported_protocols

    For remote monitoring data. If your monitoring data is exported to a remote monitoring cluster and that cluster is configured to only support TLSv1, you must update this setting.

  • reindex.ssl.supported_protocols

    For reindex from remote. If you reindex data from a remote Elasticsearch cluster which has SSL enabled on the http interface and that cluster is configured to only support TLSv1, you must update this setting.

  • xpack.security.transport.ssl.supported_protocols

    For incoming connections between Elasticsearch nodes. If you have specialized network equipment which inspects TLS packets between your nodes, and that equipment enforces TLSv1 you must update this setting.

The following is an example that enables TLS v1.0 for incoming HTTP connections:

xpack.security.http.ssl.supported_protocols: [ "TLSv1.3", "TLSv1.2", "TLSv1.1", "TLSv1" ]

Security on Trial Licenses

On trial licenses, xpack.security.enabled defaults to false.

In prior versions, a trial license would automatically enable security if either

  • xpack.security.transport.enabled was true; or
  • the trial license was generated on a version of X-Pack from 6.2 or earlier.

This behaviour has been now removed, so security is only enabled if:

  • xpack.security.enabled is true; or
  • xpack.security.enabled is not set, and a gold or platinum license is installed.

试用许可证的安全性
在试用许可证上,xpack.security.enabled默认为false。

在以前的版本中,如果存在以下两种情况,则试用许可证将自动启用安全性

xpack.security.transport.enabled为true; 要么
试用许可证是在6.2或更早版本的X-Pack上生成的。
现在已删除此行为,因此仅在以下情况下启用安全性:

xpack.security.enabled为true; 要么
未设置xpack.security.enabled,并且已安装金牌或白金许可证。

Watcher notifications account settings

The following settings have been removed in favor of the secure variants. The secure settings have to be defined inside each cluster node’s keystore, i.e., they are not to be specified via the cluster settings API.

  • xpack.notification.email.account..smtp.password, instead use xpack.notification.email.account..smtp.secure_password
  • xpack.notification.hipchat.account..auth_token, instead use xpack.notification.hipchat.account..secure_auth_token
  • xpack.notification.jira.account..url, instead use xpack.notification.jira.account..secure_url
  • xpack.notification.jira.account..user, instead use xpack.notification.jira.account..secure_user
  • xpack.notification.jira.account..password, instead use xpack.notification.jira.account..secure_password
  • xpack.notification.pagerduty.account..service_api_key, instead use xpack.notification.pagerduty.account..secure_service_api_key
  • xpack.notification.slack.account..url, instead use xpack.notification.slack.account..secure_url
Audit index output type removed

All the settings under the xpack.security.audit.index namespace have been removed. In addition, the xpack.security.audit.outputs setting has been removed as well.

These settings enabled and configured the audit index output type. This output type has been removed because it was unreliable in certain scenarios and this could have lead to dropping audit events while the operations on the system were allowed to continue as usual. The recommended replacement is the use of the logfile audit output type and using other components from the Elastic Stack to handle the indexing part.

审核索引输出类型已删除
xpack.security.audit.index命名空间下的所有设置均已删除。 此外,xpack.security.audit.outputs设置也已删除。

这些设置启用并配置了审核索引输出类型。 已删除此输出类型,因为在某些情况下该输出类型不可靠,并且在允许系统上的操作继续照常运行时,这可能导致丢弃审核事件。 建议的替代方法是使用日志文件审核输出类型,并使用Elastic Stack中的其他组件来处理索引部分。

Ingest User Agent processor defaults uses ecs output format

ECS format is now the default. The ecs setting for the user agent ingest processor now defaults to true.

提取用户代理处理器默认值使用ecs输出格式
ECS格式现在是默认格式。 现在,用户代理提取处理器的ecs设置默认为true。

Remove action.master.force_local

The action.master.force_local setting was an undocumented setting, used internally by the tribe node to force reads to local cluster state (instead of forwarding to a master, which tribe nodes did not have). Since the tribe node was removed, this setting was removed too.

删除action.master.force_local
action.master.force_local设置是一个未记录的设置,由部落节点内部使用,以将读取强制为本地集群状态(而不是转发至部落节点所没有的主节点)。 由于部落节点已删除,因此此设置也已删除。

Enforce cluster-wide shard limit

The cluster-wide shard limit is now enforced and not optional. The limit can still be adjusted as desired using the cluster settings API.

实施集群范围的分片限制
现在强制实施群集范围的分片限制,而不是可选的。 仍然可以使用集群设置API来调整限制。

HTTP Max content length setting is no longer parsed leniently

Previously, http.max_content_length would reset to 100mb if the setting was Integer.MAX_VALUE. This leniency has been removed.

HTTP Max内容长度设置不再宽松地解析
以前,如果设置为Integer.MAX_VALUE,则http.max_content_length会重置为100mb。 这种宽大处理已被删除。

16.Scripting changes

getDate() and getDates() removed

Fields of type long and date had getDate() and getDates() methods (for multi valued fields) to get an object with date specific helper methods for the current doc value. In 5.3.0, date fields were changed to expose this same date object directly when calling doc["myfield"].value, and the getter methods for date objects were deprecated. These methods have now been removed. Instead, use .value on date fields, or explicitly parse long fields into a date object using Instance.ofEpochMillis(doc["myfield"].value).

getDate()和getDates()已删除
long和date类型的字段具有getDate()和getDates()方法(用于多值字段),以获取具有针对当前doc值的特定于日期的帮助器方法的对象。 在5.3.0中,更改了日期字段以在调用doc [“ myfield”]。value时直接公开此相同的日期对象,并且不赞成使用日期对象的getter方法。 这些方法现已删除。 而是在日期字段上使用.value,或使用Instance.ofEpochMillis(doc [“ myfield”]。value)将长字段明确解析为日期对象。

17.Snapshot stats changes

Snapshot stats details are provided in a new structured way:

  • total section for all the files that are referenced by the snapshot.
  • incremental section for those files that actually needed to be copied over as part of the incremental snapshotting.
  • In case of a snapshot that’s still in progress, there’s also a processed section for files that are in the process of being copied.

照统计信息的详细信息以新的结构化方式提供:

快照引用的所有文件的“总计”部分。
增量部分,用于作为增量快照的一部分实际需要复制的那些文件。
如果快照仍在进行中,则还有一个用于复制文件的已处理部分。

Deprecated number_of_files, processed_files, total_size_in_bytes and processed_size_in_bytes snapshot stats properties have been removed
  • Properties number_of_files and total_size_in_bytes are removed and should be replaced by values of nested object total.
  • Properties processed_files and processed_size_in_bytes are removed and should be replaced by values of nested object processed.

已弃用的number_of_files,processed_files,total_size_in_bytes和processing_size_in_bytes个快照统计信息属性已被删除
属性number_of_files和total_size_in_bytes被删除,应由嵌套对象total的值代替。
删除属性processing_files和processing_size_in_bytes,并应将其替换为已处理的嵌套对象的值。

18.High-level REST client changes

API methods accepting Header argument have been removed

All API methods accepting headers as a Header varargs argument, deprecated since 6.4, have been removed in favour of the newly introduced methods that accept instead a RequestOptions argument. In case you are not specifying any header, e.g. client.index(indexRequest) becomes client.index(indexRequest, RequestOptions.DEFAULT). In case you are specifying headers e.g. client.index(indexRequest, new Header("name" "value")) becomes client.index(indexRequest, RequestOptions.DEFAULT.toBuilder().addHeader("name", "value").build());

接受Header参数的API方法已被删除
从6.4开始,已删除所有接受将标头作为Header varargs参数的API方法,而采用了新引入的接受RequestOptions参数的方法。 如果您没有指定任何标题,例如 client.index(indexRequest)变为client.index(indexRequest,RequestOptions.DEFAULT)。 如果您要指定标题,例如 client.index(indexRequest, new Header(“name” “value”)) becomes client.index(indexRequest, RequestOptions.DEFAULT.toBuilder().addHeader(“name”, “value”).build());

Cluster Health API default to cluster level

The Cluster Health API used to default to shards level to ease migration from transport client that doesn’t support the level parameter and always returns information including indices and shards details. The level default value has been aligned with the Elasticsearch default level: cluster.

群集运行状况API默认为群集级别
群集运行状况API过去默认使用分片级别,以简化从不支持level参数的传输客户端的迁移,并且始终返回包括索引和分片详细信息的信息。 级别默认值已与Elasticsearch默认级别:集群对齐。

19.Low-level REST client changes

Support for maxRetryTimeout removed from RestClient

RestClient and RestClientBuilder no longer support the maxRetryTimeout setting. The setting was removed as its counting mechanism was not accurate and caused issues while adding little value.

从RestClient中删除了对maxRetryTimeout的支持
RestClient和RestClientBuilder不再支持maxRetryTimeout设置。 该设置已删除,因为其计数机制不准确,并在增加价值的同时引起了问题。

Deprecated flavors of performRequest have been removed

We deprecated the flavors of performRequest and performRequestAsync that do not take Request objects in 6.4.0 in favor of the flavors that take Request objects because those methods can be extended without breaking backwards compatibility.

performRequest不再使用的样式已被删除
我们弃用了6.4.0中不采用Request对象的performRequest和performRequestAsync风格,而采用采用Request对象的风格,因为可以扩展这些方法而不会破坏向后兼容性。

Removed setHosts

We deprecated setHosts in 6.4.0 in favor of setNodes because it supports host metadata used by the NodeSelector.

删除了setHosts
我们在6.4.0中不推荐使用setHosts,而推荐使用setNodes,因为它支持NodeSelector使用的主机元数据。

Minimum compiler version change

The minimum compiler version on the low-level REST client has been bumped to JDK 8.

最低编译器版本更改
低级REST客户端上的最低编译器版本已提高到JDK 8。

20.Logging changes

New JSON format log files in log directory

Elasticsearch now will produce additional log files in JSON format. They will be stored in *.json suffix files. Following files should be expected now in log directory: * ${cluster_name}_server.json * ${cluster_name}_deprecation.json * ${cluster_name}_index_search_slowlog.json * ${cluster_name}_index_indexing_slowlog.json * ${cluster_name}.log * ${cluster_name}_deprecation.log * ${cluster_name}_index_search_slowlog.log * ${cluster_name}_index_indexing_slowlog.log * ${cluster_name}_audit.json * gc.log

Note: You can configure which of these files are written by editing log4j2.properties.

日志目录中的新JSON格式日志文件
Elasticsearch现在将以JSON格式生成其他日志文件。 它们将存储在* .json后缀文件中。 现在应该在日志目录中包含以下文件:* $ {cluster_name} _server.json * $ {cluster_name} _deprecation.json * $ {cluster_name} _index_search_slowlog.json * $ {cluster_name} _index_indexing_slowlog.json * $ {cluster_name} .log * $ {cluster_name} _deprecation.log * $ {cluster_name} _index_search_slowlog.log * $ {cluster_name} _index_indexing_slowlog.log * $ {cluster_name} _audit.json * gc.log

注意:您可以通过编辑log4j2.properties来配置要写入的文件。

Log files ending with *.log deprecated

Log files with the .log file extension using the old pattern layout format are now considered deprecated and the newly added JSON log file format with the .json file extension should be used instead. Note: GC logs which are written to the file gc.log will not be changed.

以* .log结尾的日志文件已弃用
现在认为使用旧模式布局格式的.log文件扩展名的日志文件已被弃用,而应使用新添加的扩展名为.json的JSON日志文件格式。 注意:不会更改写入文件gc.log的GC日志。

Docker output in JSON format

All Docker console logs are now in JSON format. You can distinguish logs streams with the type field.

JSON格式的Docker输出
现在,所有Docker控制台日志均为JSON格式。 您可以使用类型字段来区分日志流。

Audit plaintext log file removed, JSON file renamed

Elasticsearch no longer produces the ${cluster_name}_access.log plaintext audit log file. The ${cluster_name}_audit.log files also no longer exist; they are replaced by ${cluster_name}_audit.json files. When auditing is enabled, auditing events are stored in these dedicated JSON log files on each node.

审核纯文本日志文件已删除,JSON文件已重命名

Elasticsearch不再产生$ {cluster_name} _access.log纯文本审核日志文件。 $ {cluster_name} _audit.log文件也不再存在; 它们由$$ {cluster_name} _audit.json文件替换。 启用审核后,审核事件将存储在每个节点上的这些专用JSON日志文件中。

21.Node start up

Nodes with left-behind data or metadata refuse to start

Repurposing an existing node by changing node.master or node.data to false can leave lingering on-disk metadata and data around, which will not be accessible by the node’s new role. Beside storing non-accessible data, this can lead to situations where dangling indices are imported even though the node might not be able to host any shards, leading to a red cluster health. To avoid this,

  • nodes with on-disk shard data and node.data set to false will refuse to start
  • nodes with on-disk index/shard data and both node.master and node.data set to false will refuse to start

Beware that such role changes done prior to the 7.0 upgrade could prevent node start up in 7.0.

具有遗留数据或元数据的节点拒绝启动
通过将node.master或node.data更改为false来重新利用现有节点,可能会留下挥之不去的磁盘元数据和数据,而该节点的新角色将无法访问它们。 除了存储不可访问的数据之外,这还可能导致导入悬空索引的情况,即使该节点可能无法托管任何分片,也会导致群集状态为红色。 为了避免这种情况,

磁盘上的分片数据和node.data设置为false的节点将拒绝启动
具有磁盘索引/分片数据且node.master和node.data都设置为false的节点将拒绝启动
请注意,在7.0升级之前完成此类角色更改可能会阻止节点在7.0中启动。

22.Replacing Joda-Time with java time

Since Java 8 there is a dedicated java.time package, which is superior to the Joda-Time library, that has been used so far in Elasticsearch. One of the biggest advantages is the ability to be able to store dates in a higher resolution than milliseconds for greater precision. Also this will allow us to remove the Joda-Time dependency in the future.

The mappings, aggregations and search code switched from Joda-Time to java time.

用Java时间替换Joda-Time
从Java 8开始,有一个专用的java.time程序包,它优于Joda-Time库,该包到目前为止已在Elasticsearch中使用。 最大的优势之一是能够以比毫秒更高的分辨率来存储日期,以实现更高的精度。 同样,这将使我们将来能够消除对Joda-Time的依赖。

映射,聚合和搜索代码从Joda-Time切换到Java时间。

Joda based date formatters are replaced with java ones

With the release of Elasticsearch 6.7 a backwards compatibility layer was introduced, that checked if you are using a Joda-Time based formatter, that is supported differently in java time. A log message was emitted, and you could create the proper java time based formatter prefixed with an 8.

With Elasticsearch 7.0 all formatters are now java based, which means you will get exceptions when using deprecated formatters without checking the deprecation log in 6.7. In the worst case you may even end up with different dates.

An example deprecation message looks like this, that is returned, when you try to use a date formatter that includes a lower case Y

Use of 'Y' (year-of-era) will change to 'y' in the next major version of
Elasticsearch. Prefix your date format with '8' to use the new specifier.
# 在下一个主要版本中,“ Y”(年份)的使用将更改为“ y”
# Elasticsearch。 在日期格式前加上“ 8”以使用新的说明符。

So, instead of using YYYY.MM.dd you should use 8yyyy.MM.dd.

You can find more information about available formatting strings in the DateTimeFormatter javadocs.

因此,应该使用8yyyy.MM.dd而不是YYYY.MM.dd。

您可以在DateTimeFormatter javadocs中找到有关可用格式字符串的更多信息。

Date formats behavioural change

The epoch_millis and epoch_second formatters no longer support scientific notation.

If you are using the century of era formatter in a date (C), this will no longer be supported.

The year-of-era formatting character is a Y in Joda-Time, but a lowercase y in java time.

The week-based-year formatting character is a lowercase x in Joda-Time, but an upper-case Y in java time.

日期格式的行为变化
epoch_millis和epoch_second格式化程序不再支持科学计数法。

如果您在日期(C)中使用Century Century Formatter,则将不再支持此功能。

年份格式字符在Joda-Time中为Y,在Java time中为小写y。

基于周的年份格式字符在Joda-Time中为小写x,但在Java time中为大写Y。

Using time zones in the Java client

Timezones have to be specified as java time based zone objects. This means, instead of using a org.joda.time.DateTimeZone the use of java.time.ZoneId is required.

Examples of possible uses are the QueryStringQueryBuilder, the RangeQueryBuilder or the DateHistogramAggregationBuilder, each of them allow for an optional timezone for that part of the search request.

在Java客户端中使用时区
时区必须指定为基于Java时间的时区对象。 这意味着需要使用java.time.ZoneId来代替org.joda.time.DateTimeZone。

可能的用法示例是QueryStringQueryBuilder,RangeQueryBuilder或DateHistogramAggregationBuilder,它们每个都为搜索请求的该部分提供了可选的时区。

Parsing aggregation buckets in the Java client

The date based aggregation buckets in responses used to be of type JodaTime. Due to migrating to java-time, the buckets are now of type ZonedDateTime. As the client is returning untyped objects here, you may run into class cast exceptions only when running the code, but not at compile time, ensure you have proper test coverage for this in your own code.

在Java客户端中解析聚合存储桶
响应中基于日期的聚合存储桶曾经是JodaTime类型。 由于迁移到java-time,因此存储桶现在为ZonedDateTime类型。 由于客户端将在此处返回未类型化的对象,因此仅在运行代码时,您可能会遇到类强制转换异常,但在编译时可能不会,请确保在自己的代码中对此具有适当的测试覆盖率。

Parsing GMT0 timezone with JDK8 is not supported

When you are running Elasticsearch 7 with Java 8, you are not able to parse the timezone GMT0 properly anymore. The reason for this is a bug in the JDK, which has not been fixed for JDK8. You can read more in the official issue

不支持使用JDK8解析GMT0时区
当您使用Java 8运行Elasticsearch 7时,您将无法再正确解析时区GMT0。 原因是JDK中的错误,尚未针对JDK8修复。 您可以在官方杂志上阅读更多内容

Scripting with dates should use java time based methods

If dates are used in scripting, a backwards compatibility layer has been added that emulates the Joda-Time methods, but logs a deprecation message as well to use the java time methods.

The following methods will be removed in future versions of Elasticsearch and should be replaced.

  • getDayOfWeek() will be an enum instead of an int, if you need to use an int, use getDayOfWeekEnum().getValue()
  • getMillis() should be replaced with toInstant().toEpochMilli()
  • getCenturyOfEra() should be replaced with get(ChronoField.YEAR_OF_ERA) / 100
  • getEra() should be replaced with get(ChronoField.ERA)
  • getHourOfDay() should be replaced with getHour()
  • getMillisOfDay() should be replaced with get(ChronoField.MILLI_OF_DAY)
  • getMillisOfSecond() should be replaced with get(ChronoField.MILLI_OF_SECOND)
  • getMinuteOfDay() should be replaced with get(ChronoField.MINUTE_OF_DAY)
  • getMinuteOfHour() should be replaced with getMinute()
  • getMonthOfYear() should be replaced with getMonthValue()
  • getSecondOfDay() should be replaced with get(ChronoField.SECOND_OF_DAY)
  • getSecondOfMinute() should be replaced with getSecond()
  • getWeekOfWeekyear() should be replaced with get(WeekFields.ISO.weekOfWeekBasedYear())
  • getWeekyear() should be replaced with get(WeekFields.ISO.weekBasedYear())
  • getYearOfCentury() should be replaced with get(ChronoField.YEAR_OF_ERA) % 100
  • getYearOfEra() should be replaced with get(ChronoField.YEAR_OF_ERA)
  • toString(String) should be replaced with a DateTimeFormatter
  • toString(String,Locale) should be replaced with a DateTimeFormatter

使用日期编写脚本应使用基于Java时间的方法
如果脚本中使用了日期,则会添加一个向后兼容层,该层可模拟Joda-Time方法,但也会记录弃用消息,以使用Java时间方法。

以下方法将在Elasticsearch的未来版本中删除,应予以替换。

Negative epoch timestamps are no longer supported

With the switch to java time, support for negative timestamps has been removed. For dates before 1970, use a date format containing a year.

负纪元时间戳不再受支持
随着切换到Java时间,对负时间戳的支持已被删除。 对于1970年之前的日期,请使用包含年份的日期格式。

Breaking changes in 7.1

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.1.

See also Release highlights and Release notes.

7.1中的重大更改
本部分讨论将应用程序迁移到Elasticsearch 7.1时需要注意的更改。

另请参见发行要点和发行说明。

1.HTTP changes

Deprecation of old HTTP settings

The http.tcp_no_delay setting is deprecated in 7.1. It is replaced by http.tcp.no_delay.
弃用旧的HTTP设置
在7.1中不推荐使用http.tcp_no_delay设置。 它由http.tcp.no_delay代替。

2.Network changes

Deprecation of old network settings

The network.tcp.connect_timeout setting is deprecated in 7.1. This setting was a fallback setting for transport.connect_timeout. To change the default connection timeout for client connections, modify transport.connect_timeout.

弃用旧的网络设置

在7.1中不推荐使用network.tcp.connect_timeout设置。 此设置是transport.connect_timeout的后备设置。 要更改客户端连接的默认连接超时,请修改transport.connect_timeout。

3.Transport changes

Deprecation of old transport settings

The following settings are deprecated in 7.1. Each setting has a replacement setting that was introduced in 6.7.

  • transport.tcp.port is replaced by transport.port
  • transport.tcp.compress is replaced by transport.compress
  • transport.tcp.connect_timeout is replaced by transport.connect_timeout
  • transport.tcp_no_delay is replaced by transport.tcp.no_delay
  • transport.profiles.profile_name.tcp_no_delay is replaced by transport.profiles.profile_name.tcp.no_delay
  • transport.profiles.profile_name.tcp_keep_alive is replaced by transport.profiles.profile_name.tcp.keep_alive
  • transport.profiles.profile_name.reuse_address is replaced by transport.profiles.profile_name.tcp.reuse_address
  • transport.profiles.profile_name.send_buffer_size is replaced by transport.profiles.profile_name.tcp.send_buffer_size
  • transport.profiles.profile_name.receive_buffer_size is replaced by transport.profiles.profile_name.tcp.receive_buffer_size

7.1中不推荐使用以下设置。 每个设置都有6.7中引入的替换设置。

Breaking changes in 7.2

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.2.

See also Release highlights and Release notes.

7.2中的重大更改
本部分讨论将应用程序迁移到Elasticsearch 7.2时需要注意的更改。

另请参见发行要点和发行说明。

1.Discovery changes

Only a single port may be given for each seed host.

In earlier versions you could include a range of ports in entries in the discovery.seed_hosts list, but Elasticsearch used only the first port in the range and unexpectedly ignored the rest. For instance if you set discovery.seed_hosts: "10.11.12.13:9300-9310" then Elasticsearch would only use 10.11.12.13:9300 for discovery. Seed host addresses containing port ranges are now rejected.

每个种子主机只能指定一个端口。
在早期版本中,您可以在Discovery.seed_hosts列表的条目中包括一定范围的端口,但是Elasticsearch仅使用范围中的第一个端口,而意外地忽略了其余端口。 例如,如果您设置了Discovery.seed_hosts:
“ 10.11.12.13:9300-9310”,那么Elasticsearch将仅使用10.11.12.13:9300进行发现。 现在拒绝包含端口范围的种子主机地址。

Breaking changes in 7.3

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.3.

See also Release highlights and Release notes.

1.API changes

Transform API changes

It is no longer possible to supply the format parameter when you define a date_histogram transform pivot. Previously constructed transforms will still run but the configured format will be ignored.

2.Mapping changes

dense_vector field now requires dims parameter, specifying the number of dimensions for document and query vectors for this field.

映射更改
density_vector字段现在需要dims参数,为该字段指定文档和查询向量的维数。

Defining multi-fields within multi-fields

Previously, it was possible to define a multi-field within a multi-field. Defining chained multi-fields is now deprecated and will no longer be supported in 8.0. To resolve the issue, all instances of fields that occur within a fields block should be removed from the mappings, either by flattening the chained fields blocks into a single level, or by switching to copy_to if appropriate.

在多字段中定义多字段
以前,可以在多字段中定义一个多字段。 现在不建议使用定义链接的多字段,并且8.0将不再支持该定义。 要解决此问题,应通过将链接的字段块展平为单个级别,或在合适的情况下切换到copy_to,从映射中删除出现在字段块中的所有字段实例。

3.Plugins changes

IndexStorePlugin changes

IndexStore and DirectoryService have been replaced by a stateless and simple DirectoryFactory interface to create custom Lucene directory instances per shard.

IndexStorePlugin更改
IndexStore和DirectoryService已由无状态且简单的DirectoryFactory接口取代,以为每个分片创建自定义Lucene目录实例。

4.Search changes

Deprecation of queries

The common query has been deprecated. The same functionality can be achieved by the match query if the total number of hits is not tracked.

搜索更改
弃用查询
普通查询已被弃用。 如果未跟踪总点击数,则匹配查询可以实现相同的功能。

Deprecation of query parameters

The cutoff_frequency parameter has been deprecated for match and multi_match queries. The same functionality can be achieved without any configuration provided that the total number of hits is not tracked.

弃用查询参数
对于匹配查询和multi_match查询,不建议使用cutoff_frequency参数。 如果未跟踪总点击数,则无需任何配置即可实现相同的功能。

5.CCR changes

Directly modifying aliases of follower indices is no longer allowed

Aliases are now replicated to a follower from its leader, so directly modifying aliases on follower indices is no longer allowed.

不再允许直接修改关注者索引的别名
现在,别名已从其领导者复制到关注者,因此不再允许直接修改关注者索引上的别名。

Breaking changes in 7.4

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.4.

See also Release highlights and Release notes.

7.4中的重大更改
本部分讨论将应用程序迁移到Elasticsearch 7.4时需要注意的更改。

另请参见发行要点和发行说明。

1.Plugins changes

TokenizerFactory changes

TokenizerFactory now has a name() method that must be implemented. Most plugin-provided TokenizerFactory implementations will extend AbstractTokenizerFactory, which now takes a name parameter in its constructor.

TokenizerFactory的更改
TokenizerFactory现在具有必须实现的name()方法。 大多数插件提供的TokenizerFactory实现都将扩展AbstractTokenizerFactory,该类现在在其构造函数中使用一个name参数。

2.Search Changes

Forbid empty doc values in vector functions

If a document doesn’t have a value for a vector field (dense_vector or sparse_vector) on which a vector function is executed, an error will be thrown.

搜索更改
向量函数中禁止空doc值
如果文档没有执行矢量功能的矢量字段的值(dense_vector或sparse_vector),则将引发错误。

Use float instead of double for query vectors

Previously, vector functions like cosineSimilarity represented the query vector as an list of doubles. Now vector functions use floats, which matches how the stored document vectors are represented.

使用float而不是double来查询向量
以前,像cosineSimilarity这样的向量函数将查询向量表示为双精度列表。 现在矢量函数使用浮点数,该浮点数与表示存储的文档矢量的方式匹配。

3.Snapshot and Restore changes

The S3 repository plugin uses the DNS style access pattern by default

Starting in version 7.4 the repository-s3 plugin does not use the now-deprecated path-style access pattern by default. In versions 7.0, 7.1, 7.2 and 7.3 the repository-s3 plugin always used the path-style access pattern. This is a breaking change for deployments that only support path-style access but which are recognized as supporting DNS-style access by the AWS SDK. If your deployment only supports path-style access and is affected by this change then you must configure the S3 client setting path_style_access to true. This breaking change was made necessary by AWS’s announcement that the path-style access pattern is deprecated and will be unsupported on buckets created after September 30th 2020.

快照和还原更改
S3存储库插件默认使用DNS样式访问模式
从7.4版开始,repository-s3插件默认不使用现在不建议使用的路径样式访问模式。 在7.0、7.1、7.2和7.3版本中,repository-s3插件始终使用路径样式的访问模式。 对于仅支持路径样式访问但被AWS开发工具包识别为支持DNS样式访问的部署而言,这是一个重大更改。 如果您的部署仅支持路径样式访问并且受此更改影响,则必须将S3客户端设置path_style_access设置为true。 AWS宣布已弃用路径样式访问模式,并且在2020年9月30日之后创建的存储桶中将不支持此声明,因此有必要进行这一重大更改。

4.HTTP changes

Changes to Encoding Plus Signs in URLs

Starting in version 7.4, a + in a URL will be encoded as %2B by all REST API functionality. Prior versions handled a + as a single space. If your application requires handling + as a single space you can return to the old behaviour by setting the system property es.rest.url_plus_as_space to true. Note that this behaviour is deprecated and setting this system property to true will cease to be supported in version 8.

URL中编码加号的更改
从7.4版开始,所有REST API功能会将URL中的+编码为%2B。 以前的版本将+视为一个空格。 如果您的应用程序需要将+作为单个空格处理,则可以通过将系统属性es.rest.url_plus_as_space设置为true来返回旧的行为。 请注意,此行为已弃用,并且版本8将不再支持将此系统属性设置为true。

5.Cluster changes

Rerouting after starting a shard runs at lower priority

After starting each shard the elected master node must perform a reroute to search for other shards that could be allocated. In particular, when creating an index it is this task that allocates the replicas once the primaries have started. In versions prior to 7.4 this task runs at priority URGENT, but starting in version 7.4 its priority is reduced to NORMAL. In a well-configured cluster this reduces the amount of work the master must do, but means that a cluster with a master that is overloaded with other tasks at HIGH or URGENT priority may take longer to allocate all replicas.

Additionally, before 7.4 the GET _cluster_health?wait_for_no_initializing_shards and GET _cluster/health?wait_for_no_relocating_shards APIs would return only once all pending reroutes have completed too, but starting in version 7.4 if you want to wait for the rerouting process to completely finish you should add the wait_for_events=languid query parameter when calling these APIs.

集群变化
启动分片后重新路由以较低的优先级运行
启动每个分片后,当选的主节点必须执行重新路由以搜索可以分配的其他分片。特别是,在创建索引时,一旦主数据库启动,此任务便分配副本。在7.4之前的版本中,此任务的运行优先级为URGENT,但是从7.4版开始,其优先级降低为NORMAL。在配置良好的集群中,这减少了主服务器必须执行的工作量,但是这意味着具有主服务器的集群以其他优先级高或紧急的任务过载的情况下,可能需要更长的时间来分配所有副本。

此外,在7.4之前
_cluster_health?wait_for_no_initializing_shards和GET
_cluster / health?wait_for_no_relocating_shards API也将仅在所有未完成的重新路由完成后返回,但是从7.4版开始,如果要等待重新路由过程完全完成,则应在调用这些API时添加wait_for_events = languid查询参数。

6.Allocation changes

Auto-release of read-only-allow-delete block

If a node exceeds the flood-stage disk watermark then Elasticsearch adds the index.blocks.read_only_allow_delete block to all of its indices to prevent further writes, as a last-resort attempt to prevent the node completely exhausting its disk space. In earlier versions this block would remain in place until manually removed, causing confusion for users who currently have ample disk space and who are not aware that they nearly ran out at some point in the past. From 7.4 onwards the block is automatically removed when the node drops below the high watermark again, with the expectation that the high watermark is some distance below the flood-stage watermark and therefore the disk space problem is truly resolved. Since this block may be automatically removed, you can no longer rely on adding this block manually to prevent writes to an index. You should use the index.blocks.read_only block instead. This behaviour can be disabled by setting the system property es.disk.auto_release_flood_stage_block to false.

分配变更
自动释放只读允许删除块
如果节点超过了泛洪阶段磁盘水印,那么Elasticsearch会将index.blocks.read_only_allow_delete块添加到其所有索引中,以防止进一步写入,这是最后一次尝试,目的是防止节点完全耗尽其磁盘空间。在较早的版本中,此块将保留在原位,直到手动将其删除为止,这会给当前拥有足够磁盘空间并且不知道自己过去几乎快要用完的用户造成混乱。从7.4开始,当节点再次下降到高水位线以下时,该块将被自动删除,并期望高水位线在洪水阶段水位线以下一段距离,从而真正解决了磁盘空间问题。由于此块可能会自动删除,因此您不再可以依赖手动添加此块来防止写入索引。您应该改用index.blocks.read_only块。可以通过将系统属性es.disk.auto_release_flood_stage_block设置为false来禁用此行为。

7.Settings changes

Authentication realm name uniqueness is enforced

Authentication realm name uniqueness is now enforced. If you configure more than one realm of any type with the same name, the node fails to start.

强制执行身份验证领域名称唯一性
现在强制执行身份验证领域名称唯一性。 如果您配置多个具有相同名称的任何类型的领域,则该节点将无法启动。

pidfile setting is being replaced by node.pidfile

To ensure that all settings are in a proper namespace, the pidfile setting is deprecated, and will be removed in version 8.0.0. Instead, use node.pidfile.

pidfile设置被替换为node.pidfile
为确保所有设置都在正确的命名空间中,不建议使用pidfile设置,该设置将在8.0.0版中删除。 而是使用node.pidfile。

processors setting is being replaced by node.processors

To ensure that all settings are in a proper namespace, the processors setting is deprecated, and will be removed in version 8.0.0. Instead, use node.processors.

处理器设置被替换为node.processors
为确保所有设置都在正确的命名空间中,不赞成使用处理器设置,并且将在8.0.0版中将其删除。 而是使用node.processors。

8.Transform changes

Stats response format changes

The response format of the Get transform statistics is very different to previous versions:

  • task_state and indexer_state are combined into a single state field that replaces the old state object.
  • Within the checkpointing object, current is renamed to last and in_progress to next.
  • The checkpoint number is now nested under last and next.
  • checkpoint_progress is now reported in an object nested in the next checkpoint object. (If there is no next checkpoint then no checkpoint is in progress and by definition the last checkpoint is 100% complete.)

For an example of the new format see Examples.

改变变化
统计资料回应格式变更
获取转换统计信息的响应格式与以前的版本非常不同:

task_state和indexer_state合并为一个替换旧状态对象的状态字段。
在检查点对象中,current重命名为last,in_progress重命名为next。
现在,检查点编号嵌套在last和next下。
现在在嵌套在下一个检查点对象中的一个对象中报告checkpoint_progress。 (如果没有下一个检查点,则没有任何检查点正在进行,并且根据定义,最后一个检查点已完成100%。)
有关新格式的示例,请参见示例。

9.Data frame analytics changes

Changes to progress reporting

The single integer progress_percent field at the top level of the data frame analytics job stats is replaced by a progress field that is an array of objects. Each object contains the phase name and progress_percent of one phase of the analytics. For example:

数据框分析更改
进度报告变更
数据框分析作业统计信息顶层的单个整数progress_percent字段由进度字段代替,该进度字段是对象数组。 每个对象都包含阶段名称和一个分析阶段的progress_percent。 例如:

{
  "id" : "my_job",
  "state" : "analyzing",
  "progress" : [
    {
      "phase" : "reindexing",
      "progress_percent" : 100
    },
    {
      "phase" : "loading_data",
      "progress_percent" : 100
    },
    {
      "phase" : "analyzing",
      "progress_percent" : 47
    },
    {
      "phase" : "writing_results",
      "progress_percent" : 0
    }
  ]
}

Breaking changes in 7.5

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.5.

See also Release highlights and Release notes.

7.5中的重大更改
本部分讨论将应用程序迁移到Elasticsearch 7.5时需要注意的更改。

另请参见发行要点和发行说明。

1.Search Changes

Stricter checking for wildcard queries on _index

Previously, a wildcard query on the _index field matched directly against the fully-qualified index name. Now, in order to match against remote indices like cluster:index, the query must contain a colon, as in cl*ster:inde*. This behavior aligns with the way indices are matched in the search endpoint.

搜索更改
严格检查_index上的通配符查询
以前,_index字段上的通配符查询直接与标准索引名称匹配。 现在,为了与诸如cluster:index的远程索引进行匹配,查询必须包含一个冒号,如cl * ster:inde *。 此行为与在搜索端点中匹配索引的方式一致。

Breaking changes in 7.6

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.6.

See also Release highlights and Release notes.

7.6中的重大更改
本部分讨论将应用程序迁移到Elasticsearch 7.6时需要注意的更改。

另请参见发行要点和发行说明。

1.Security changes

Elasticsearch API key privileges

If you use an API key to create another API key (sometimes called a derived key), its behavior is impacted by the fix for CVE-2020-7009.

When you make a request to create API keys, you can specify an expiration and privileges for the API key. Previously, when you created a derived key, it had no privileges. This behavior disregarded any privileges that you specified in the create API key API.

As of 7.6.2, this behavior changes. To create a derived key, you must explicitly specify a role descriptor with no privileges:

安全变更
Elasticsearch API密钥特权
如果使用API密钥创建另一个API密钥(有时称为派生密钥),则其行为会受到CVE-2020-7009修复程序的影响。

当您请求创建API密钥时,可以指定API密钥的到期时间和特权。 以前,创建派生密钥时,它没有特权。 此行为无视您在create API key API中指定的任何特权。

从7.6.2开始,此行为更改。 要创建派生密钥,必须显式指定没有特权的角色描述符:

...
"role_descriptors": {
    "no-privilege": {
    }
}
...

2.Search changes

Deprecation of sparse vector fields

The sparse_vector field type has been deprecated and will be removed in 8.0. We have not seen much interest in this experimental field type, and don’t see a clear use case as it’s currently designed. If you have feedback or suggestions around sparse vector functionality, please let us know through GitHub or the discuss forums.

稀疏向量场的弃用
sparse_vector字段类型已被弃用,并将在8.0中删除。 我们对这种实验性字段类型没有太多兴趣,也没有看到目前设计的明确用例。 如果您对稀疏矢量功能有任何反馈或建议,请通过GitHub或讨论论坛让我们知道。

Update to vector function signatures

The vector functions of the form function(query, doc['field']) are deprecated, and the form function(query, 'field') should be used instead. For example, cosineSimilarity(query, doc['field']) is replaced by cosineSimilarity(query, 'field').

Disallow use of the nGram and edgeNGram tokenizer names

The nGram and edgeNGram tokenizer names haven been deprecated with 7.6. Mappings for indices created after 7.6 will continue to work but emit a deprecation warning. The tokenizer name should be changed to the fully equivalent ngram or edge_ngram names for new indices and in index templates.

禁止使用nGram和edgeNGram标记程序名称
7.6不建议使用nGram和edgeNGram标记程序名称。 在7.6之后创建的索引的映射将继续起作用,但会发出弃用警告。 对于新索引和在索引模板中,令牌化程序名称应更改为完全等效的ngram或edge_ngram名称。

Breaking changes in 7.7

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.7.

See also What’s new in 7.7 and Release notes.

1.Logging changes

Loggers under org.elasticsearch.action now log at INFO level by default

The default log level for most loggers is INFO, but in earlier versions loggers in the org.elasticsearch.action.* hierarchy emitted log messages at DEBUG level by default. This sometimes resulted in a good deal of unnecessary log noise. From 7.7 onwards the default log level for logger in this hierarchy is now INFO, in line with most other loggers. If needed, you can recover the pre-7.7 default behaviour by adjusting your logging.

默认情况下,org.elasticsearch.action下的记录器现在以INFO级别记录
大多数记录器的默认日志级别是INFO,但是在早期版本中,org.elasticsearch.action。*层次结构中的记录器默认情况下以DEBUG级别发出日志消息。 有时这会导致大量不必要的对数噪声。 从7.7开始,此层次结构中记录器的默认日志级别现在为INFO,与大多数其他记录器一致。 如果需要,可以通过调整日志记录来恢复7.7之前的默认行为。

2.Mapping changes

Validation for dynamic templates

So far misconfiguration of dynamic templates have been discovered when indexing a document with an unmapped field only. In Elasticsearch 8.0 and later versions, dynamic mappings have stricter validation, done at mapping update time. Invalid updates, such as using incorrect analyzer settings or unknown field types, fail. For indices created in Elasticsearch 7.7 and later version, the update succeeds but emits a warning.

验证动态模板
迄今为止,仅在使用未映射字段索引文档时,已经发现动态模板的配置错误。 在Elasticsearch 8.0和更高版本中,动态映射具有更严格的验证,在映射更新时完成。 无效的更新(例如使用不正确的分析器设置或未知的字段类型)将失败。 对于在Elasticsearch 7.7和更高版本中创建的索引,更新成功,但发出警告。

3.Settings changes

thread_pool.listener.size and thread_pool.listener.queue_size have been deprecated

The listener thread pool is no longer used internally by Elasticsearch. Therefore, these settings have been deprecated. You can safely remove these settings from the configuration of your nodes.

thread_pool.listener.size和thread_pool.listener.queue_size已被弃用
Elasticsearch不再在内部使用侦听器线程池。 因此,不建议使用这些设置。 您可以从节点的配置中安全地删除这些设置。

cluster.remote.connect is deprecated in favor of node.remote_cluster_client

Previously the setting cluster.remote.connect was used to configure whether or not the local node is capable of acting as a remote cluster client in cross-cluster search and cross-cluster replication. This setting is deprecated in favor of node.remote_cluster_client serves the same purpose and identifies the local node as having the remote_cluster_client role.

不推荐使用cluster.remote.connect,而推荐使用node.remote_cluster_client
以前,设置cluster.remote.connect用来配置本地节点是否能够在跨集群搜索和跨集群复制中充当远程集群客户端。 不建议使用此设置,以支持node.remote_cluster_client具有相同目的,并将本地节点标识为具有remote_cluster_client角色。

Authentication realm order will be a required config in version 8.0.0.

The order config will be required in version 8.0.0 for authentication realm configuration of any type. If the order config is missing for a realm, the node will fail to start.

身份验证领域顺序将是8.0.0版中的必需配置。
对于任何类型的身份验证领域配置,版本8.0.0中都将需要order config。 如果某个领域缺少订单配置,则该节点将无法启动。

Authentication realm order uniqueness will be enforced in version 8.0.0.

The order config of authentication realms must be unique in version 8.0.0. If you configure more than one realm of any type with the same order, the node will fail to start.

身份验证领域订单的唯一性将在版本8.0.0中强制实施。
身份验证领域的顺序配置在版本8.0.0中必须唯一。 如果以相同顺序配置多个任何类型的领域,则该节点将无法启动。

Deprecation of insecure monitoring password setting

The auth.password setting for the monitoring HTTP exporter has been deprecated and will be removed in version 8.0.0. Please use the auth.secure_password setting instead.

不赞成使用不安全的监视密码设置
监视HTTP导出程序的auth.password设置已被弃用,并将在8.0.0版中删除。 请改用auth.secure_password设置。

4.Search changes

Consistent rounding of range queries on date_range fields

range queries on date_range field currently can have slightly differently boundaries than their equivalent query on a pure date field. This can e.g. happen when using date math or dates that don’t specify up to the last millisecond. While queries on date field round up to the latest millisecond for gt and lte boundaries, the same queries on date_range fields didn’t do this. The behavior is now the same for both field types like documented in Date math and rounding.

对date_range字段进行范围查询的一致舍入
当前,针对date_range字段的范围查询的边界可能与针对纯日期字段的等效查询的边界稍有不同。 这可以例如 使用日期数学或未指定最近毫秒的日期时发生。 尽管对日期字段的查询会四舍五入到gt和lte边界的最新毫秒,但对date_range字段的相同查询则不会这样做。 现在,这两种字段类型的行为都相同,如日期数学和舍入中所述。

Pipeline aggregation validation errors

The pipeline aggregation validation has been moved to the coordinating node. Those errors that used to return HTTP 500s/Internal Server Errors now return 400/Bad Request and we now return a list of validation errors rather than the first one we encounter.

管道聚合验证错误
管道聚合验证已移至协调节点。 那些曾经返回HTTP 500s /内部服务器错误的错误现在返回400 /错误请求,我们现在返回一个验证错误列表,而不是遇到的第一个错误。

5.Highlighters changes

Ignored keyword values are no longer highlighted

If a keyword value was ignored during indexing because of its length (ignore_above parameter was applied), Elasticsearch doesn’t attempt to highlight it anymore, which means no highlights are produced for ignored values.

忽略的关键字值不再突出显示
如果在索引过程中由于关键字值的长度而忽略了关键字值(已应用ignore_above参数),Elasticsearch将不再尝试突出显示它,这意味着不会为忽略的值生成任何突出显示。

Breaking changes in 7.8

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.8.

Breaking changes in 7.9

This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 7.9.

你可能感兴趣的:(Elasticsearch,elasticsearch)