使用reindex API
POST _reindex
{
"source": {
"remote": {
"host": "http://192.168.138.85:9200"
},
"index": "flow_collector-2018.05.04"
},
"dest": {
"index": "flow_collector-2018.05.04"
}
}
回報錯誤
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[hit] failed to parse [_source]",
"line": 1,
"col": 356
}
],
"type": "exception",
"reason": "Error parsing the response, remote is likely not an Elasticsearch instance",
"caused_by": {
"type": "parsing_exception",
"reason": "[search_response] failed to parse field [hits]",
"line": 1,
"col": 356,
"caused_by": {
"type": "parsing_exception",
"reason": "[hits] failed to parse field [hits]",
"line": 1,
"col": 356,
"caused_by": {
"type": "parsing_exception",
"reason": "[hit] failed to parse field [_source]",
"line": 1,
"col": 356,
"caused_by": {
"type": "parsing_exception",
"reason": "[hit] failed to parse [_source]",
"line": 1,
"col": 356,
"caused_by": {
"type": "json_parse_exception",
"reason": "Duplicate field '8'\n at [Source: org.apache.http.nio.entity.ContentInputStream@97d2840; line: 1, column: 376]"
}
}
}
}
}
},
"status": 500
}
想詢問一下該如何解決
謝謝
POST _reindex
{
"source": {
"remote": {
"host": "http://192.168.138.85:9200"
},
"index": "flow_collector-2018.05.04"
},
"dest": {
"index": "flow_collector-2018.05.04"
}
}
回報錯誤
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[hit] failed to parse [_source]",
"line": 1,
"col": 356
}
],
"type": "exception",
"reason": "Error parsing the response, remote is likely not an Elasticsearch instance",
"caused_by": {
"type": "parsing_exception",
"reason": "[search_response] failed to parse field [hits]",
"line": 1,
"col": 356,
"caused_by": {
"type": "parsing_exception",
"reason": "[hits] failed to parse field [hits]",
"line": 1,
"col": 356,
"caused_by": {
"type": "parsing_exception",
"reason": "[hit] failed to parse field [_source]",
"line": 1,
"col": 356,
"caused_by": {
"type": "parsing_exception",
"reason": "[hit] failed to parse [_source]",
"line": 1,
"col": 356,
"caused_by": {
"type": "json_parse_exception",
"reason": "Duplicate field '8'\n at [Source: org.apache.http.nio.entity.ContentInputStream@97d2840; line: 1, column: 376]"
}
}
}
}
}
},
"status": 500
}
想詢問一下該如何解決
謝謝
2 个回复
yayg2008
赞同来自: laoyang360
按照现在的异常,“"[hit] failed to parse [_source]",”,意思就是_source格式化异常,你可以先检查一下_source的内容是否正常。再一个,检查下之前的index是否有存储source。
gentrice
赞同来自:
感謝回復,的確之前的index沒有設定_source,是否能在之前的index設定_source後再執行reindex?