【发布时间】:2018-01-31 16:11:29
【问题描述】:
我正在尝试为 Discovery 上的文档编制索引,但其中一个文档导致了此错误:
Error during document enrichment. Details: "The language of the document could not be identified."
这是我要转换的文本:
Ao tentar emitir uma nota fiscal eletrônica o sistema apresenta a seguinte mensagem: Informar email no cadastro de clientes.
Acessar o cadastro do cliente no qual está emitindo a nota fiscal eletrônica, na aba Complementares e informar o e-mail do cliente no campo E-Mail.
这是我的索引功能:
function indexDocument(doc) {
return new Promise((resolve, reject) => {
discovery.addDocument({
environment_id: config.watson.environment_id,
collection_id: config.watson.collection_id,
file: {
value: JSON.stringify(doc),
options: {
filename: 'ocorrencia_' + doc.ocorrencia_id + '.json',
contentType: 'application/json; charset=utf-8'
}
}
}, (error, data) => {
if (error) {
reject(error);
} else {
resolve(data);
}
});
});
}
有人知道为什么会出现这个问题吗?有没有办法在 Discovery 上索引文档时直接指定语言?
【问题讨论】:
标签: node.js watson watson-discovery