ES报错:illegal_argument_exception

在这里插入图片描述


1.场景描述
ES中创建映射

PUT /usertag/_doc/_mapping?pretty 
{
  "_doc": {
    "properties": {
      "memberId": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },
      "phone": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },
      "sex": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },
      "channel": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },
      "subOpenId": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },
      "address": {
        "type": "text"
      },
      "regTime": {
        "type": "date"
      },
      "orderCount": {
        "type": "long"
      },
      "orderTime": {
        "type": "date"
      },
      "orderMoney": {
        "type": "float"
      },
      "favGoods": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },
      "freeCouponTime": {
        "type": "date"
      },
      "couponTimes": {
        "type": "date"
      },
      "chargeMoney": {
        "type": "double"
      },
      "overTime": {
        "type": "long"
      },
      "feedBack": {
        "type": "long"
      }
    }
  }
}

2.报错信息
在这里插入图片描述

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "request [/usertag/_doc/_mapping] contains unrecognized parameter: [pretty ] -> did you mean [pretty]?"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "request [/usertag/_doc/_mapping] contains unrecognized parameter: [pretty ] -> did you mean [pretty]?"
  },
  "status": 400
}

3.错误分析
在这里插入图片描述
关键语句:illegal_argument_exception
contains unrecognized parameter: [pretty ] -> did you mean [pretty]

意思:非法参数,包含不识别的参数:pretty空格 是不是想用pretty


4.解决问题
去掉pretty后边的空格即可


5.最终结果

{
  "acknowledged" : true
}

在这里插入图片描述

  • 8
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

海若[MATRIX]

鼓励将是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值