Elasticsearch6调研纪录

公司打算明年在一些业务上应用ES6+,所以今天开始会做一些调研工作。

整体目标是熟悉一些常见的用法,以及了解如何确保业务可以在ES上持续的迭代。

下面逐步记录一些关键的知识点,可能也是ES6不同于以往版本的一些内容:

  1. 不支持indextypehttps://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
  2. 父子文档使用变化:https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html
  3. 移除_all,使用copy_tohttps://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-all-field.html
  4. doc_value(默认true):列存字段,高效的正向查询,避免排序聚合读_sourcehttps://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
  5. enabled(默认true):false字段不索引,不判定类型,直接存储在_sourcehttps://www.elastic.co/guide/en/elasticsearch/reference/current/enabled.html
  6. index(默认true):false字段不索引,但是有类型,仍旧存储在_sourcehttps://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-index.html
  7. store(默认false):控制某些字段单独存储,可以单独返回,避免读一个很大_source字段。https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html
  8. filter:这个语法变化比较多,6.x版本:https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html
  9. PHP客户端:https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/_quickstart.html
  10. painless脚本(自定义相关性):https://www.elastic.co/guide/en/elasticsearch/painless/6.1/painless-specification.html

我在github上维护了一些简单的demo脚本,大家可以按需了解。

如果文章帮助您解决了工作难题,您可以帮我点击屏幕上的任意广告,或者赞助少量费用来支持我的持续创作,谢谢~