elasticsearch - 创建索引的未知键 [高]

标签 elasticsearch kibana

我在 Elasticsearch 中创建了一个索引,看起来像

{"amazingdocs":{"aliases":{},"mappings":{"properties":{"Adj Close":{"type":"text"},"Close":{"type":"text"},"Date":{"type":"text"},"High":{"type":"text"},"Low":{"type":"text"},"Open":{"type":"text"},"Volume":{"type":"text"}}},"settings":{"index":{"creation_date":"1563168811565","number_of_shards":"1","number_of_replicas":"1","uuid":"k2wCARIETvufWmrdkDOtyw","version":{"created":"7020099"},"provided_name":"amazingdocs"}}}}

但是现在当我尝试使用 kibana 向其中插入文档时,出现以下错误

{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "unknown key [High] for create index"
      }
    ],
    "type": "parse_exception",
    "reason": "unknown key [High] for create index"
  },
  "status": 400
}

语法,我遵循的是

PUT /amazingdocs/ 
{
    "Date": "1960-10-06",
    "Open": "53.720001",
    "High": "53.720001",
    "Low": "53.720001",
    "Close": "53.720001",
    "Adj Close": "53.720001",
    "Volume": "2510000"
}

此外,当我尝试插入具有相似字段的批量数据时,出现以下错误

"{"took":66336,"errors":true,"items":[{"index":{"_index":"amazingdocs","_type":"_doc","_id":"O7o_9GsBcUaBu1lEWjja","status":400,"error":{"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}}}}

最佳答案

你按照错误的语法插入弹性,写入语法将是

PUT /amazingdocs/_doc/1 
{
    "Date": "1960-10-06",
    "Open": "53.720001",
    "High": "53.720001",
    "Low": "53.720001",
    "Close": "53.720001",
    "Adj Close": "53.720001",
    "Volume": "2510000"
}

引用 - here

关于elasticsearch - 创建索引的未知键 [高],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57034190/

相关文章:

elasticsearch - 是否可以在NEST上查询多个术语字段(.NET)的聚合?

iis - 如何从iis日志中正确设置logstash中的时间戳

elasticsearch - 正确的语法,用于在Kibana可视化中将过滤器聚合添加为JSON输入(过滤特定属性值)

elasticsearch - Kibana 不需要的千位分隔符

elasticsearch - 在 Elasticsearch 中生成数据表

java - ElasticSearch。如何使用QueryBuilders生成 “$in”

ruby-on-rails - Searchkick - 尾随特殊字符

json - Elasticsearch-使用jq导出到CSV

kibana - 如何在 Kibana 中列出特定字段的唯一值

kibana - 如何使用 SSL 在 Filebeat 和 Elasticsearch 之间建立安全连接