zoukankan      html  css  js  c++  java
  • ES field store yes no 区别——可以设置为false,如果_source有的话

    store

    By default, field values are indexed to make them searchable, but they are not stored. This means that the field can be queried, but the original field value cannot be retrieved.

    Usually this doesn’t matter. The field value is already part of the _source field, which is stored by default. If you only want to retrieve the value of a single field or of a few fields, instead of the whole_source, then this can be achieved with source filtering.

    In certain situations it can make sense to store a field. For instance, if you have a document with atitle, a date, and a very large content field, you may want to retrieve just the title and the datewithout having to extract those fields from a large _source field:

    PUT my_index
    {
      "mappings": {
        "my_type": {
          "properties": {
            "title": {
              "type": "text",
              "store": true 
            },
            "date": {
              "type": "date",
              "store": true 
            },
            "content": {
              "type": "text"
            }
          }
        }
      }
    }
    
    PUT my_index/my_type/1
    {
      "title":   "Some short title",
      "date":    "2015-01-01",
      "content": "A very long content field..."
    }
    
    GET my_index/_search
    {
      "stored_fields": [ "title", "date" ] 
    }

     

    The title and date fields are stored.

    This request will retrieve the values of the title and date fields.

    来自:https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html

  • 相关阅读:
    PTA——List Leaves
    pta——电话聊天狂人(c二叉树实现)
    Anti-SG游戏 与 SJ定理笔记(反Nim博弈)
    Unicode代码点与代码单元
    奇偶校验位
    IPv6与IPv4的位数
    0- win10配置java环境变量问题
    小计划
    路径问题
    getResource(path)的注意事项
  • 原文地址:https://www.cnblogs.com/bonelee/p/6428653.html
Copyright © 2011-2022 走看看