首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用elasticsearch -红宝石创建elasticsearch中的ingest管道

如何使用elasticsearch -红宝石创建elasticsearch中的ingest管道
EN

Stack Overflow用户
提问于 2018-04-26 14:19:20
回答 2查看 561关注 0票数 0

我在挣扎,如何使用elasticsearch-红宝石创建吞食附件管道?

为了这个电话-

代码语言:javascript
复制
PUT _ingest/pipeline/attachment
{
  "description" : "Extract attachment information",
  "processors" : [
    {
      "attachment" : {
        "field" : "data"
      }
    }
  ]
}

这是我得到的例外-

代码语言:javascript
复制
2.2.5 :008 > client.ingest.put_pipeline({id: 'attachment', body: {description: "Extract attachment information", processors: { attachment: { field: 'document_content', indexed_chars: '-1', indexed_chars_field: "max_size"}}}})
2018-04-27 08:22:07 +0530: PUT http://localhost:9200/_ingest/pipeline/attachment [status:400, request:0.108s, query:N/A]
2018-04-27 08:22:07 +0530: > {"description":"Extract attachment information","processors":{"attachment":{"field":"document_content","indexed_chars":"-1","indexed_chars_field":"max_size"}}}
2018-04-27 08:22:07 +0530: < {"error":{"root_cause":[{"type":"parse_exception","reason":"[processors] property isn't a list, but of type [java.util.HashMap]","header":{"property_name":"processors"}}],"type":"parse_exception","reason":"[processors] property isn't a list, but of type [java.util.HashMap]","header":{"property_name":"processors"}},"status":400}
2018-04-27 08:22:07 +0530: [400] {"error":{"root_cause":[{"type":"parse_exception","reason":"[processors] property isn't a list, but of type [java.util.HashMap]","header":{"property_name":"processors"}}],"type":"parse_exception","reason":"[processors] property isn't a list, but of type [java.util.HashMap]","header":{"property_name":"processors"}},"status":400}
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"parse_exception","reason":"[processors] property isn't a list, but of type [java.util.HashMap]","header":{"property_name":"processors"}}],"type":"parse_exception","reason":"[processors] property isn't a list, but of type [java.util.HashMap]","header":{"property_name":"processors"}},"status":400}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-04-27 03:05:50

误差状态

属性不是列表,而是类型为java.util.HashMap的

在REST调用中,它是正确的,因为processors是一个数组,但是在您的ruby调用中,您将它变成了一个散列。

所以正确的方法是这样做:

代码语言:javascript
复制
 client.ingest.put_pipeline :id => 'attachment', :body => {description: "Extract attachment information", processors: [{ attachment: { field: 'document_content', indexed_chars: '-1', indexed_chars_field: "max_size"}}]}
票数 1
EN

Stack Overflow用户

发布于 2018-04-27 03:14:39

这是正确的说法-

client.ingest.put_pipeline :id => 'attachment', :body => {description: "Extract attachment information", processors: [{ attachment: { field: 'document_content', indexed_chars: '-1'}}]}

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50045373

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档