多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### 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](https://en.wikipedia.org/wiki/Powerset_construction#Complexity)” a regex as `max_determinized_states` instead of the typo`max_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 from`geo_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_field`will 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`](https://issues.apache.org/jira/browse/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`](https://issues.apache.org/jira/browse/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“来控制.