我已经安装了摄取附件处理器,并且正在使用Java代码从一个索引读取文件路径,documents并在另一个索引中索引文件内容documents_attachment。在此过程中,如果文件可用,它将解码为base64并将这些内容附加到json字段fileContent并在另一个index中将这些字段索引documents_attachment。如果文件不可用,则尝试将null值附加到json字段,fileContent并尝试对这些字段进行索引。在此过程中,当我尝试插入nulljson字段时遇到以下错误fileContent。请在下面找到错误。ElasticsearchStatusException[Elasticsearch exception [type=exception, reason=java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: field [fileContent] is null, cannot parse.]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=java.lang.IllegalArgumentException: field [fileContent] is null, cannot parse.]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=field [fileContent] is null, cannot parse.]]; at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177) at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:573) at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:549) at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:456) at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:429) at org.elasticsearch.client.RestHighLevelClient.index(RestHighLevelClient.java:312) at com.es.utility.DocumentIndex.main(DocumentIndex.java:193) Suppressed: org.elasticsearch.client.ResponseException: method [PUT], host [http://localhost:9200], URI [/document_attachment_dev/doc/129439?pipeline=document_attachment_dev&timeout=1m], status line [HTTP/1.1 500 Internal Server Error]请找到我的Java代码。
1 回答
白衣非少年
TA贡献1155条经验 获得超0个赞
我正在为摄取附件处理器使用以下映射配置,并且在文件内容不可用(空)时它正在工作。
PUT _ingest/pipeline/document_attachment
{
"description" : "my first pipeline with handled exceptions",
"processors" : [
{
"attachment" : {
"field" : "fileContent",
"on_failure" : [
{
"set" : {
"field" : "error",
"value" : "{{ _ingest.on_failure_message }}"
}
}
]
}
}
]
}
添加回答
举报
0/150
提交
取消