“没有类型[版本]的处理程序”使用弹性搜索7.10.2

发布于 2025-01-27 15:21:04 字数 1758 浏览 3 评论 0 原文

我将Amazon OpenSearch服务升级为使用Elastic Search 7.10,以便我可以使用数据字段类型“版本”(Documentation 在字段[testfield] 上声明的类型[版本]没有处理程序。知道我做错了什么吗?

这是创建新索引的卷曲命令和响应:

$ curl -X PUT ${host}/test-index -H "Content-Type: application/json" -d '{"mappings":{"properties":{"testField":{"type":"version"}}}}'
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"No handler for type [version] declared on field [testField]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: No handler for type [version] declared on field [testField]","caused_by":{"type":"mapper_parsing_exception","reason":"No handler for type [version] declared on field [testField]"}},"status":400}%

其中 $ {host} 是指向弹性搜索服务器的环境变量,

test-test-index 是新索引名称,

testField 是新字段名称。


这是自定义配置的一个预处理的版本:

{
  "mappings": {
    "properties": {
      "testField": {
        "type": "version"
      }
    }
  }
}

这是弹性搜索版本的打印输出(7.10.2):

$ curl $host
{
  "name" : "9d6bXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "cluster_name" : "5971XXXXXXXX:my-custom-environment",
  "cluster_uuid" : "RbQGXXXXXXXXXXXXXXXXXX",
  "version" : {
    "number" : "7.10.2",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "unknown",
    "build_date" : "2022-02-10T09:41:23.620550Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

I upgraded my Amazon OpenSearch service to use Elastic Search 7.10 so that I can use the data field type "Version" (Documentation here), however I still cannot create an index that uses the Version field type because it throws a mapper_parsing_exception. The error message is No handler for type [version] declared on field [testField]. Any idea what I am doing wrong?

This is the curl command and response for creating a new index:

$ curl -X PUT ${host}/test-index -H "Content-Type: application/json" -d '{"mappings":{"properties":{"testField":{"type":"version"}}}}'
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"No handler for type [version] declared on field [testField]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: No handler for type [version] declared on field [testField]","caused_by":{"type":"mapper_parsing_exception","reason":"No handler for type [version] declared on field [testField]"}},"status":400}%

where ${host} is an environment variable pointing to the elastic search server,

test-index is the new index name,

and testField is the new field name.


This is a prettified version of the custom configuration:

{
  "mappings": {
    "properties": {
      "testField": {
        "type": "version"
      }
    }
  }
}

This is a printout of the Elastic Search version (which is 7.10.2):

$ curl $host
{
  "name" : "9d6bXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "cluster_name" : "5971XXXXXXXX:my-custom-environment",
  "cluster_uuid" : "RbQGXXXXXXXXXXXXXXXXXX",
  "version" : {
    "number" : "7.10.2",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "unknown",
    "build_date" : "2022-02-10T09:41:23.620550Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆橘 2025-02-03 15:21:04

我可以从7.10.0版本中看到,ES可以支持版本类型
这是7.10.2

I can see from 7.10.0 version, ES can support version type
Here is the datatype support in 7.10.2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文