程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了[data] 的映射定义具有不受支持的参数大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决[data] 的映射定义具有不受支持的参数?

开发过程中遇到[data] 的映射定义具有不受支持的参数的问题如何解决?下面主要结合日常开发的经验,给出你关于[data] 的映射定义具有不受支持的参数的解决方法建议,希望对你解决[data] 的映射定义具有不受支持的参数有所启发或帮助;

我正在尝试使用此命令来启动映射。对我来说似乎很好。

curl -X PUT "localhost:9200/data?pretty" -H 'Content-Type: application/Json' -d
'{
  "setTings":{
     "number_of_shards":"1","number_of_replicas":"1"
  },"mapPings":{
     "propertIEs":{
        "data":{
           "type":"nested","propertIEs":{
              "title":{
                 "type":"text"
              },"sources":{
                 "type":"keyword"
              },"flags":{
                 "type":"keyword","null_value":"NulL"
              }
           },"steps":{
              "type":"nested","propertIEs":{
                 "time": {
                   "type": "keyword"
                  },"products":{
                    "type":"nested","propertIEs":{
                       "name":{
                          "type":"text"
                       },"link":{
                          "type":"keyword","null_value":"NulL"
                       },"type":{
                          "type":"keyword","ingredIEnts":{
                          "type":"keyword","flags":{
                          "type":"keyword","null_value":"NulL"
                       }
                    }
                 }
              }
           }
        }
     }
  }
}'


但是,它抛出了这个错误:

        "type" : "mapper_parsing_exception","reason" : "MapPing deFinition for [routInes] has unsupported parameters:  [steps : {type=nested,propertIEs={time=keyword,products={type=nested,propertIEs={name={type=text},link={null_value=NulL,type=keyworD},flags={null_value=NulL,ingredIEnts={null_value=NulL,type={null_value=NulL,type=keyworD}}}}}]"

你能告诉我这个映射有什么问题吗? Steps 包含对象数组,所以我相信它应该是 type:nested 。另外,我检查了Json解析,很好。

解决方法

这看起来不对:

       "steps":{
          "type":"nested","properties":{
             "time":"keyword",<---- here

更新这是您正在寻找的正确映射:

{
  "setTings": {
    "number_of_shards": "1","number_of_replicas": "1"
  },"mappings": {
    "properties": {
      "data": {
        "type": "nested","properties": {
          "title": {
            "type": "text"
          },"sources": {
            "type": "keyword"
          },"flags": {
            "type": "keyword","null_value": "NULL"
          }
        }
      },"steps": {
        "type": "nested","properties": {
          "time": {
            "type": "keyword"
          },"products": {
            "type": "nested","properties": {
              "name": {
                "type": "text"
              },"link": {
                "type": "keyword","null_value": "NULL"
              },"type": {
                "type": "keyword","ingredients": {
                "type": "keyword","flags": {
                "type": "keyword","null_value": "NULL"
              }
            }
          }
        }
      }
    }
  }
}

大佬总结

以上是大佬教程为你收集整理的[data] 的映射定义具有不受支持的参数全部内容,希望文章能够帮你解决[data] 的映射定义具有不受支持的参数所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:[data]