zoukankan      html  css  js  c++  java
  • ES禁用_source不会影响聚合

    From Elasticsearch's website:

    The _source field contains the original JSON document body that was passed at index time. The _source field itself is not indexed (and thus is not searchable), but it is stored so that it can be returned when executing fetch requests, like get or search

    Disabling the source will prevent Elasticsearch from displaying it in the resultset. However, filtering, querying and aggregations will not be affected.

    So these two queries will not generate any results in terms of the actual body:

    GET mq-body-local/body/_search

    GET mq-body-local/body/1

    However, you could run this aggregation that will include some of the source, for example:

    POST mq-body-local/body/_search
    
    {
      "aggs": {
        "test": {
          "terms": {
            "field": "body"
          }
        }
      }
    }
    

    Will produce this result set (I've created some test records):

    "aggregations": {
        "test": {
          "doc_count_error_upper_bound": 0,
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "my body",
              "doc_count": 1
            },
            {
              "key": "my body2",
              "doc_count": 1
            }
          ]
        }
      }
    
  • 相关阅读:
    前端布局定位
    CSS优化
    CSS工程化
    CSS过渡,动画,2D,3D转换
    CSS,盒子和美化技巧
    HTMl
    定位和布局
    CSS选择器
    八. 实时更新插件 livereload
    七. 浏览器插件 View in Browser
  • 原文地址:https://www.cnblogs.com/bonelee/p/6432324.html
Copyright © 2011-2022 走看看