close

引用網址:https://www.felayman.com/articles/2017/11/15/1510733125940.html

【原文地址】Breaking changes in 6.0

- Elasticsearch 6.0版本中的重大变化(Breaking changes in 6.0)

该部分讨论,如果你想讲你的应用程序迁移至Elasticsearch 6.0,你所需要了解版本升级带来的变更点.

- 在6.0之前创建索引(Indices created before 6.0)

Elasticsearch 6.0能够读取那些在 5.0及以上的版本创建的索引. 但是一个运行着Elasticsearch 6.0实例的节点将不再会读取那些在5.0及以下版本创建的索引.

 从Elasticseach 2.x及以下版本进行索引重建 那些在Elasticsearch 2.x及以前的版本所创建的索引将需要进行索引重建以便于这些索引能够被Elasticsearch 6.x进行读取. 对老索引进行重建的最佳的方式是试验"reindex"API.

 索引创建不再支持多类型 一个索引支持多个类型映射的功能已经在6.0版本中取消了.新的索引将受限于只能创建一个单独的索引.这只是为了能够完全地移除类型映射的初步计划.在5.x版本创建的索引能够继续支持多类型映射. 请参考 Removal of mapping types 来了解更多关于移除类型映射的信息

- 其他变化

- 聚合变化(Aggregations changes)

在include_exclude中使用"pattern"元素来进行terms聚合功能已经移除

在进行terms聚合的时候"include"和"exclude"能够接受一个"pattern"参数对象功能已经取消.取而代之的是,"pattern"应该直接作为"include"和"exclude"字段的一个值传入.比如下面的terms聚合:

POST /twitter/_search?size=0
{
    "aggs" : {
        "top_users" : {
            "terms" : {
                "field" : "user",
                "include": {
                  "pattern": "foo.*"
                },
                "exclude": {
                  "pattern": ".*bar"
                }
            }
        }
    }
}

应该被替换为:

POST /twitter/_search?size=0
{
    "aggs" : {
        "top_users" : {
            "terms" : {
                "field" : "user",
                "include": "foo.*",
                "exclude": ".*bar"
            }
        }
    }
}

“date_range”中的from和to参数现在能够根据"format"进行格式化解析”

在"date_range“聚合中的两个关于数字类型的参数"to"和"from"会被以"epoch_millis"方式进行解析,其他数字类型的格式比如"epoch_seconds"不能用于输入数字类型.现在我们会根据"format"来解析这些目标字段的参数.如果在类型映射的format不是用数字输入值兼容,兼容的格式(例如 epoch_millisepoch_second)必须在date_range聚集指定,否则抛出一个错误。(聚合地方不是太了解,直接翻译于有道词典)

原文地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_aggregations_changes.html

- Cat API变化(Cat API changes)

如果之前一个队列所支持的线程池是无界的,则会在使用cat api的线程池的会在queue_size列输出一个空字符串.
现在变成输出-1来取代空字符串,并且该字段的值永远是数值类型(不是字符串类型)

原文地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_cat_changes.html

- 客户端变化(Clients changes)

从5.6.0 版本起,发布了一个新的Java客户端: Java High Level REST Client.

Elasticsearch提供该官方高级客户(叫这个名字的区别于现有的低层次的客户)是被用于执行搜索,索引,删除,更新以及bulk操作,这些操作同样能够被java核心类"TransportClient"来完成。

Java High Level REST Client 被设计用来在不久的将来取代"TransportClient"客户端。

原文地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_clients_changes.html

- 集群变化(Cluster changes)

之前的版本,集群名称能够在"path.data"中使用,当然系统会给一个warning警告.但是现在不允许这样使用了.
比如在之前的版本下面的配置是无效的:

# Assuming path.data is /tmp/mydata
# No longer supported:
$ tree /tmp/mydata
/tmp/mydata
├── 
│   └── nodes
│       └── 0
│           └── 

# Should be changed to:
$ tree /tmp/mydata
/tmp/mydata
├── nodes
│   └── 0
│       └──

原文地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_cluster_changes.html

- 文档API变化(Document API changes)

1. 移除version type 中的force参数

为了覆盖之前的版本检查,文档的修改操作不再能将参数"version_type"指定为"force"

2. upsert请求不在支持版本

在upsert请中添加一个版本号将不再支持

3. 在索引API中移除了"created"字段

在使用索引API进行索引创建或批量操作时,移除了"created"字段,取而代之的是"operation"字段

4. 在删除API中移除了"found"字段

在使用删除API进行索引的删除或批量操作时,移除了"found"字段,取而代之的是"operation"字段

原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_docs_changes.html

- 索引变化(Indices changes)

1. 索引末班使用"index_patterns"来替代"template"

在之前的模板表达式中,应该在"template"字段中使用全局的类型模式.现在将会使用"index_patterns"来进行替换.该名称

Previously templates expressed the indices that they should match using a glob style pattern in the template field. They should now use the index_patterns field instead. As the name implies you can define multiple glob style patterns in an array but for convenience defining a single pattern as a bare string is also supported. So both of these examples are valid:

2. 影子副本被移除

3. 打开/关闭索引API允许通配符表达式,默认情况下不匹配任何索引

4. 删除一个文档

5. 索引别名API仅针对索引解析索引表达式

6. 索引删除API仅针对索引解析索引表达式

7. 索引表达式中取消对"+"的支持

8. 保留translog

- 预处理变化(Ingest changes)

1. 时间戳元数据字段类型被移除

2. ”ingest.new_date_format“的格式化方法发生改变

- Java API 变化(Java API changes)

1. setSource方法需要指定XContentType参数

2. ”delete by query“请求需要明确指定一个查询请求

3. 移除InternalStats和Stats类中的getCountAsString()方法

4. ActionRequestBuilder的execute方法返回ActionFuture而不是ListenableActionFuture

5. Terms.Order和Histogram.Order被BucketOrder取代

6. BulkResponse,SearchResponse,TermVectorsResponse类中的getTookInMiilis()方法被移除

7. GetField,SearchHitField被DocumentField取代

8. 一些聚合相关的类的包发生变化

9. PercentileRanksAggregationBuilder的构造器发生变化

- 映射变化(Mapping changes)

1. 强制布尔类型字段

之前版本的Elasticsearch中,能够识别出true, false, on, off, yes, no, 0, 1 作为布尔值.现在,在Elasticsearch 6.0中,只会识别true  false作为布尔值,其他值会抛出一个错误.为了更好的向后兼容,在之前的版本中如果是其他值的话还能继续工作,这意味着你不需要理解修改已经存在的mapping.但是,在从索引模板中创建索引将会严格遵循上述的布尔规则.

**2. _all字段默认关闭 **

在一个新的mapping中,_all元数据字段中默认包含从其他字段复制来的文本功能已经关闭.之前的版本中中,使用
query_string  simple_query_string查询会使用 _all字段进行查询,但是现在将会检查 _all是否启用._all字段可能在Elasticsearch 6.0或更高的版本中不再需要在创建索引的时候进行配置.

3. include_in_all现在不允许使用

由于默认情况下_all字段现在可能是不启用,因此无法再使用创建mapping的时候使用‘include_in_all`字段

4. 无法识别的match_mapping_type选项不会静默忽略

在之前版本的Elasticsearch中,如果动态模板中包含无法识别的match_mapping_type类型,现在不会忽略,并且会抛出一个无法识别类型的错误.

5. 校验日期字段的locale

在Elasticsearch之前的版本中,一个date字段中的locale选项允许任何指定字符串,如果该字符串无法识别则会被忽略.现在则会拒绝创建索引当遇到无法识别的值.

- Packaging变化(Packaging changes)

1. 为程序自定义用户及用户组不再允许

2. 不再支持path.conf作为一个配置项

3. 不再支持CONF_DIR作为一个配置项

4. 默认路径设置被移除

5. 不再维护32字节JVM

6. 不再支持”ES_JVM_OPTIONS“配置

7. 不再支持”ES_INCLUDE“配置

8. 默认堆转储文件路径

- Percolator变化(Percolator changes)

1. 不再推荐使用的percolator和mpercolate相关的apis被移除

2. 使用percolator.map_unmapped_fields_as_text替代 percolator.map_unmapped_fields_as_string

- 插件变化(Plugins changes)

1. 移除Mapper attachments plugin

2.S3 Repository plugin系列变化

一大堆配置,嚼舌,懒得翻译

  • The bucket an s3 repository is configured with will no longer be created automatically. It must exist before the s3 repository is created.
  • Support for specifying s3 credentials through environment variables and system properties has been removed. Use the elasticsearch-keystore tool to securely store the credentials.
  • Specifying region has been removed. This includes the settings cloud.aws.region, cloud.aws.s3.region, repositories.s3.region, and specifying region inside the repository settings. Instead, specify the full endpoint if a custom s3 location is needed, or rely on the default behavior which automatically locates the region of the configured bucket.
  • Specifying s3 signer type has been removed, including cloud.aws.signer and cloud.aws.s3.signer.
  • Global repositories settings have been removed. This includes repositories.s3.bucket, repositories.s3.server_side_encryption, repositories.s3.buffer_size, repositories.s3.max_retries, repositories.s3.use_throttle_retries, repositories.s3.chunk_size, repositories.s3.compress, repositories.s3.storage_class, repositories.s3.canned_acl, repositories.s3.base_path, and repositories.s3.path_style_access. Instead, these settings should be set directly in the settings per repository. See S3 Repository settings.
  • Shared client settings have been removed. This includes cloud.aws.access_key, cloud.aws.secret_key, cloud.aws.protocol, cloud.aws.proxy.host, cloud.aws.proxy.port, cloud.aws.proxy.username, cloud.aws.proxy.password, cloud.aws.signer, cloud.aws.read_timeout, cloud.aws.s3.access_key, cloud.aws.s3.secret_key, cloud.aws.s3.protocol, cloud.aws.s3.proxy.host, cloud.aws.s3.proxy.port, cloud.aws.s3.proxy.username, cloud.aws.s3.proxy.password, cloud.aws.s3.signer, cloud.aws.s3.read_timeout, repositories.s3.access_key, repositories.s3.secret_key, repositories.s3.endpoint and repositories.s3.protocol. Instead, use the new named client settings under s3.client.CLIENT_NAME.*.
  • The path_style_access setting has been removed. The repository will use the appropriate path style access based on the configured endpoint.

3. Azure Repository plugin

  • The container an azure repository is configured with will no longer be created automatically. It must exist before the azure repository is created.
  • Global repositories settings you are able to set in elasticsearch config file under repositories.azure name space have been removed. This includes repositories.azure.account, repositories.azure.container,repositories.azure.base_path, repositories.azure.location_mode, repositories.azure.chunk_size and repositories.azure.compress. You must set those settings per repository instead. Respectively account, container, base_path,location_mode, chunk_size and compress. See Azure Repository settings.

4. GCS Repository plugi

  • the service_account setting has been removed. A service account json credential file must now be specified in the elasticsearch keystore.

5. EC2 Discovery plugin

  • Specifying ec2 signer type has been removed, including cloud.aws.signer and cloud.aws.ec2.signer.
  • The region setting has been removed. This includes the settings cloud.aws.region and cloud.aws.ec2.region. Instead, specify the full endpoint.
  • All cloud.aws.* and cloud.aws.ec2.* settings have been removed. Use discovery.ec2.*settings instead.

6. 忽略隐藏文件夹

7. ICU Analysis plugin 升级

8. 插件不会再通过Settings来构造一个 Environment

- 索引重建变化(Reindex changes)

1. 如果所有文档需要重建索引,无需指定size大小

- Rest变化(REST changes)

1.不支持Unquoted JSON

2. 不支持在配置文件中设置多个重复的key

3. 取消对Content-Type的自动识别

4. 只有"true"和"false"会被识别成布尔类型

5. 不允许在请uri中使用analyzer测试

6. analyzer api支持自定义标准化

7. 索引存在api中不再接收ignore_unavailable和allow_no_indices参数

8. 请求uri中不再接收timestamp和ttl参数

9. 请求uri中不再接收timestamp和ttl参数

10. 刷新请求如果发生失败则返回500而不是再返回200

11. 查询删除API需要明确指定一个查询语句

12. 删除不存在的文档将不会再创建一个新的类型

13. Indices information APIs

14. Requests to existing endpoints with incorrect HTTP verb now return 405 responses

15. 禁止使用_cache和_cache_key

16. IndexClosedException会返回400错误码

- 信息统计变化(Stats and info changes)

store统计信息中移除throttle_time

考虑到存储上限已经被移除, store 统计信息中也不再支持throttle_time

如果磁盘在旋转时文件系统统计信息中不再报告

Elasticsearch从2.x版本起会默认假设实例运行在SSDs中.因此,Elasticsearch不再需要从操作系统收集信息,以确定每个数据路径的底层磁盘是否自旋。虽然这个功能不再需要从2开始。在节点stats api的文件系统部分中维护了x系列的弹性搜索。这些信息现在已经被删除了

原文地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_mappings_changes.html

- DSL查询变化(Search and Query DSL changes)

1. query 变化

  • span_near 查询中的 collect_payloads 参数 已经被移除.如果需要使用的话Payloads将会被加载.

  • 在布尔字段上的查询将严格的解析类似boolean的值.这将意味着只会接受字符串为"true"  "false"的值,而其他的值都会引起一个异常.

  • in 查询 (terms 查询的另一个同义形式) 被移除

  • geo_bbox 查询 (geo_bounding_box 查询的另一个同义形式) 被移除

  • mlt 查询 (more_like_this 查询的另一个同义形式) 被移除.

  • more_like_this查询中不再推荐使用的like_text, ids and docs 几个参数 (like的同义形式) 被移除. 同样 min_word_len (a synonym for min_word_length) and max_word_len (a synonym for max_word_length) 被移除.

  • fuzzy_match  match_fuzzy 查询 (match 查询的同义形式) 被移除

  • terms 查询现在返回的文档的评分为 1 且跟 indices.query.bool.max_clause_count 无关.

  • 不再推荐使用的 indices 查询被移除

  • 从查询DSL中移除对空查询对象 ({ }) 的支持. 当提供一个空的查询对象的时候会出现一个错误.

  • bool查询中不再推荐使用的 minimum_number_should_match 参数被移除, 取而代之的是 minimum_should_match .

  • The query_string query now correctly parses the maximum number of states allowed when “determinizing” a regex as max_determinized_states instead of the typomax_determined_states.

  • query_string 查询不再接收 enable_position_increment参数,取而代之的是 enable_position_increments .

  • geo_distance 查询中, 使用 sloppy_arc 选项进行排序、聚合已经从 distance_type 参数中移除.

  • The geo_distance_range query, which was deprecated in 5.0, has been removed.

  • The optimize_bbox parameter has been removed from geo_distance queries.

  • The ignore_malformed and coerce parameters have been removed fromgeo_bounding_box, geo_polygon, and geo_distance queries.

  • The disable_coord parameter of the bool and common_terms queries has been removed. If provided, it will be ignored and issue a deprecation warning.

  • The template query has been removed. This query was deprecated since 5.0

  • The percolate query’s document_type has been deprecated. From 6.0 and later it is no longer required to specify the document_type parameter.

  • The split_on_whitespace parameter for the query_string query has been removed. If provided, it will be ignored and issue a deprecation warning. The query_string query now splits on operator only.

  • The use_dismax parameter for the query_string query has been removed. If provided, it will be ignored and issue a deprecation warning. The tie_breaker parameter must be used instead.

  • The auto_generate_phrase_queries parameter for the query_string query has been removed, use an explicit quoted query instead. If provided, it will be ignored and issue a deprecation warning.

  • The all_fields parameter for the query_string has been removed. Set default_field to instead. If provided,default_fieldwill be automatically set to`

  • The index parameter in the terms filter, used to look up terms in a dedicated index is now mandatory. Previously, the index defaulted to the index the query was executed on. Now this index must be explicitly set in the request.

  • match查询中不再推荐使用的type and slop 参数被移除. 取而代之的是在match_phrase  match_phrase_prefix查询中使用 type参数.match查询中的 slop被移除但是依然适用于match_phrase  match_phrase_prefix查询.

  • match_phrase查询中不再推荐使用的phrase_slop 参数 (与slop 参数同义) 被移除.

  • constant_score查询中不再推荐使用的query 参数 (与filter 参数同义)被移除

  • multi_match查询中不再推荐使用的phrase_slop 参数 (与slop 参数同义) 被移除.

  • prefix查询中不在推荐使用的 prefix 参数 (与value 参数同义) 被移除.

  • range查询不再推荐使用的 le (与lte同义) 和 ge (与gte同义) 参数被移除.

  • 不再推荐使用的multi term重写参数 constant_score_auto, constant_score_filter ( 与constant_score同义) 已经被移除.

2. 分片查询API(search shards API)

查询分片 API不再在url参数中接受type参数,之前的版本不会受到任何影响.

3. Profile API变化

用来显示人类可读的计时输出"time"字段已经被“time_in_nanos”字段所取代,该字段显示了纳秒内的运行时间."time"字段可以通过在请求url中添加"?human=true"来打开,它将显示一个精密的、人类可读的时间值.

4. 排序变化

  • 查询归一化(Query normalization)

    查询归一化已经被取消.这意味着TF-IDF似度不再试图在查询中使分数具有可比性,而现在提高的分数是简单的乘法因子。其他相似度模型不受影响,因为它们并没有使分数归一化,而且已经集成了提升系数作为乘法因子。请参考 LUCENE-7347以了解更多信息

  • 协调因子(Coordination factors)

    协调因素已从评分公式中移除。这意味着布尔查询不再根据匹配子句的数量进行评分。相反,它们总是返回匹配子句的分数之和。

As a consequence, use of the TF-IDF similarity is now discouraged as this was an important component of the quality of the scores that this similarity produces. BM25 is recommended instead.

See LUCENE-7347 for more information

5. _uid中的Fielddata

_uid中使用Fielddata已经不再推荐使用. 仍然有可能将使用_id来替代,但是为什么还没有让他不再推荐使用,是因为它在random_score函数中被用到.如果你的确需要访问文档的id用来进行排序,聚合或者脚本查询,推荐复制id作为一个文档字段.

6. 高亮(highlighter)

unified高亮是新的高亮默认选择.内部会根据字段类型(index_options)来决定每个字段的偏移策略以及如何高亮. 仍然有可能强制让高亮成fvh 或者 plain 类型.

postings高亮已经从Lucene 和 Elasticsearch中被移除.unified高亮 输出同样的高亮效果当参数index_options被设置成offsets.

7. fielddata_fields

之前不推荐使用的fielddata_fields已经被移除. 取而代之的是使用docvalue_fields

8. docvalue_fields

docvalue_fields现在有一个默认的上限值,一个请求中最多含有100个字段.该限制可以通过索引参数设置index.max_docvalue_fields_search来覆盖.

9. script_fields

script_fields现在有一个默认的上限值,一个请求中最多限制在32个脚本字段内.该限制可以通过索引参数设置index.max_script_fields来覆盖.

10. Inner hits

The source inside a hit of inner hits keeps its full path with respect to the entire source. In prior versions the source field names were relative to the inner hit.(此段还没有明白是个啥)

11. Scroll

当在开始使用scroll的时候,”from“参数不用再使用到查询请求体中.过去如果添加了该参数,该参数将会被忽略,现在将会抛出一个错误.

12. Limit on from/size in top hits and inner hits

返回结果的最大数量(from + size)允许通过inner hits被重新取回,并且 top hits 已经限制在100内.该限制能够通过”index.max_inner_result_window“来控制.

原文地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_search_changes.html

- 设置变化(Settings changes)

1. 移除对elasticsearch.json和 elasticsearch.yaml配置文件的支持

Elasticsearch之前的配置文件支持".yml",“.yaml"或”.json"扩展文件.但是现在只支持"elasticsearch.yml".

2. 配置文件中重复的key

在Elasticsearch之前的版本中,允许如下的配置文件中存在重复的key,比如:

node:
  name: my-node

node
  attr:
    rack: my-rack

在Elasticsearch 6.0.0中,不再允许这样的配置.取而代之的,多个属性必须制定在一个单独的key中,例如:

node:
  name: my-node
  attr:
    rack: my-rack

3. 强制进行boolean类型的设置

在Elasticsearch之前的版本中,配置文件中可能会自动识别true, false, on, off, yes,no, 0, 1等字符串为boolean类型.在Elasticsearch 6.0中,仅仅会识别true and false作为布尔类型,如果是其他值则会报错.为了向后兼容,在6.x系列版本前该设置将继续工作,请注意,该设置不适用于存储在"elasticsearch.yml"配置文件中的节点级别设置.

4. 快照设置

内部参数设置的cluster.routing.allocation.snapshot.relocation_enabled“允许分片在进行快照的时候重新分配到不同的节点的功能已经被移除,如果一个shard只分配了一个节点,然后在快照运行时重新分配回这个节点,启用这个设置可能会导致分配问题.

5. 存储限制设置

存储限制被移除.因此,"indices.store.throttle.type"和"indices.store.throttle.max_bytes_per_sec"两个设置参数无法会被识别.

6. 存储设置

“default” 和 “index.store.type” 被移除. 如果你正在使用它们,我们建议你简单的从索引设置中移除它们,以及Elasticsearch将会为你的操作系统使用最佳"store".

7. 网络设置

阻塞的TCP客户端以及阻塞的TCP服务,甚至阻塞的HTTP服务都已经被移除.因此,network.tcp.blocking_server, network.tcp.blocking_client,network.tcp.blocking,transport.tcp.blocking_client, transport.tcp.blocking_server, 和 http.tcp.blocking_server等设置都不再会被识别.之前不再使用的设置如
transport.netty.max_cumulation_buffer_capacity,transport.netty.max_composite_buffer_components http.netty.max_cumulation_buffer_capacity 也已经都被移除.

8.相似性设置

基本的相似性现在被忽略了,因为coords和查询规范化已经被删除了。如果提供,该设置将被忽略并发出弃用警告

9.脚本设置

所有存在脚本安全问题的设置都被移除掉了.取而代之的是script.allowed_types and script.allowed_contexts.All of the existing scripting security settings have been removed. Instead they are replaced with script.allowed_types and script.allowed_contexts.设置参数script.max_compilations_per_minute已经被script.max_compilation_rate取代,该设置由一个时间比例组成,比如:75/5m.

10.发现设置

discovery.type设置不再支持以下值:gce, aws and ec2. 集成这些平台应该由discovery.zen.hosts_provider设置成他们中的一个值.

- 脚本变化(Scripting changes )

1. 移除Groovy, JavaScript, and Python等脚本语言

roovy, JavaScript, and Python等脚本语法已经在5.0版不再推荐使用,现在这些脚本语言已经被移除.取而代之的是推荐是painless语言.

2. 移除本地脚本

本地脚本都被移除,取而代之的是,请实现"ScriptEngine"

3. 移除脚本文件

脚本文件已经都被移除.取而代之的是使用存储脚本.同时,关联设置"path.scripts"也已经被移除.

4. 日期字段现在返回日期

由于使用epoch(时间点)过长,在"doc.some_date_field.value"中的字段现在返回"ReadableDateTime"取代milliseconds.同样的还有doc.some_date_field[some_number].如果你需要获取毫秒数,你可以使用doc.some_date_field.value.millis来获取毫秒数

5. 移除通过索引内部变量"_index"来访问索引

"_index"变量已经被移除.如果你需要使用它来进行高级评分,请考虑自己实现一个"Similarity"插件.

6. 脚本设置

所有存在脚本安全的设置都被移除.取而代之的是两个新的设置,script.allowed_types和script.allowed_contexts

7. 当存储脚本作为请求的一部分时,不再需要指定"lang"参数

当发送存储脚本请求时,"lang"参数不再需要进行指定,否则会出现一个错误.请注意,一个使用存储脚本的请求不同于一个设置存储脚本的请求.脚本语言已经存储为集群状态的一部分,“id”足以访问执行存储脚本所需的所有信息.

The lang variable can no longer be specified as part of a request that uses a stored script otherwise an error will occur. Note that a request using a stored script is different from a request that puts a stored script. The language of the script has already been stored as part of the cluster state and an id is sufficient to access all of the information necessary to execute a stored script.

8. 当进行脚本设置,获取,或者删除一个存储脚本的时候,脚本参数"lang"不再使用

当你在"_scripts"路径下使执行put,get,和delete操作的时候,不再需要指定"lang"参数作为url请求的一部分.所有的存储脚本必须有一个唯一的"id"作为唯一的命名空间,而不再需要"lang"和"id"一起作为唯一的命名空间.

Stored scripts can no longer have the lang parameter specified as part of the url when performing PUT, GET, and DELETE actions on the _scripts/ path. All stored scripts must have a unique id as the namespace is only id now and no longer lang and id.

9. 移除存储查询模板API

使用"_search/template" api 进行 put,get 和 delete操作都被移除.存储查询模板API已经被存储脚本API取代.

例如,之前你可能存储了如下查询模板:

PUT /_search/template/custom_template
{
  "query": {
    "match": {
      "f1": "{{f1}}"
    }
  }
}

取而代之的是如下的存储脚本:

PUT /_scripts/custom_template
{
  "script": {
    "lang": "mustache",
    "source": {
      "query": {
        "match": {
          "f1": "{{f1}}"
        }
      }
    }
  }
}

arrow
arrow
    文章標籤
    elk
    全站熱搜

    龍之家族 發表在 痞客邦 留言(0) 人氣()