3

我是弹性搜索的新手。我试图索引附件但收到错误。我已经执行了以下步骤。安装了 Mapper-attachment 插件

我已经使用 openssl 命令将文本文件转换为 base64

      openssl enc -base64 -in test3.txt -out t3.file

之后我创建了映射

     [root@n1 testcase]# curl -XPUT 'http://localhost:9200/indextryes/?pretty=1'  -d '
      { "mappings" : { "doc" : { "properties" : {"file" : {"type" : "attachment"}}}}}'

     {
      "ok" : true,
        "acknowledged" : true
     }

当我尝试索引它时,我收到以下错误消息

      [root@n1 testcase]# curl -X POST "localhost:9200/indextryes/text" -d @t3.file  
     {"error":"MapperParsingException[failed to parse]; nested: ElasticSearchParseException[Failed to derive xcontent from (offset=0, length=64): [98, 71, 86, 48, 99, 121, 66, 107, 98, 121, 66, 104, 98, 109, 57, 48, 97, 71, 86, 121, 73, 72, 82, 108, 99, 51, 81, 103, 89, 87, 53, 107, 73, 72, 90, 108, 99, 109, 108, 109, 101, 83, 66, 108, 98, 71, 70, 122, 100, 71, 108, 106, 99, 50, 86, 104, 99, 109, 78, 111, 76, 103, 61, 61]]; ","status":400}

感谢帮助...

4

0 回答 0