zoukankan      html  css  js  c++  java
  • ES6 Fielddata is disabled on text fields by default

    使用ES做聚合运算的时候,有时候会遇到这个错误

    Fielddata is disabled on text fields by default. Set fielddata=true on [host] 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.

    这时候有两个解决办法:一个是设置字段开启fielddata  一个是查询的时候使用字段名称加keyword

    具体方法可以参考官方文档:

       https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#enable-fielddata-text-fields

    解决方法请尝试开启这个字段:

    PUT filebeat-2020.12.19.19
    
    {
      "mappings": {
        "type": {
          "properties": {
            "host": {
              "type": "text",
              "fielddata": true
            }
          }
        }
      }
    }
    PUT web-nginx-5xxlog-2020.12/_mapping/log
    {
        "properties":{
            "host":{
                "type":"text",
                "fielddata":true
            },
            "url":{
                "type":"text",
                "fielddata":true
            }
            
        }
    }

    参考文档:

         https://www.cnblogs.com/xingxia/p/elasticsearch_problems.html

  • 相关阅读:
    数据后台查询分页条件查询数据
    避免js缓存
    jquery点击按钮
    网页内容打印
    数据表的导出
    C#实现字符串按多个字符采用Split方法分割
    JQuery
    AJAX
    JSON
    BOM
  • 原文地址:https://www.cnblogs.com/topicjie/p/14161098.html
Copyright © 2011-2022 走看看