zoukankan      html  css  js  c++  java
  • Fielddata is disabled on text fields by default. Set fielddata=true on [XXX] in order to load fielddata in memory by uninverting the inverted index.

    1、报错信息:

    Fielddata is disabled on text fields by default. Set fielddata=true on [createTime] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.

    2、翻译如下:

    默认情况下在文本字段中禁用 Fielddata。在字段 [createTime] 上设置 fielddata=true,以便通过不反转反转索引将 fielddata 加载到内存中。注意,这可能会使用大量内存,或者使用关键字 [keyWord] 字段代替。

    3、报错原因:

    ElasticSearch 5.x 版本之后将 String 类型去掉了,以 text 和 keyWord 代替。

    官方解释如下:https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html

    4、如何解决:

    PUT 你的index/_mapping/你的type/
    {
      "properties": {
        "你的字段": { 
          "type":     "text或keyWord",
          "fielddata"true
        }
      }
    }

    修改报错中提到的字段类型,修改为 text 或 keyWord。以 createTime 字段为例:

    PUT 我的index/_mapping/我的type/
    {
      "properties": {
        "createTime": { 
          "type":     "text",
          "fielddata"true
        }
      }
    }
  • 相关阅读:
    JS学习之旅2
    JS学习之旅1
    Stack 栈
    Linked List 链表
    Array 数组
    时间/空间复杂度
    What/Why/How
    Https 握手过程
    JS跨域解决方案
    JS 的内存管理-GC
  • 原文地址:https://www.cnblogs.com/niceyoo/p/14115305.html
Copyright © 2011-2022 走看看