• 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

  • 相关阅读:
    vector数组的翻转与排序
    20210310日报
    vector数组的遍历
    vector数组的删除
    vector数组的插入
    20210304日报
    20210303日报
    20210302日报
    计算datetime.date n个月后(前)的日期
    pandas 重命名MultiIndex列
  • 原文地址:https://www.cnblogs.com/topicjie/p/14161098.html
Copyright © 2020-2023  润新知