作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在将Elasticsearch 1.2.2与PHP包装器Elastica一起使用
在索引某些文档时,我遇到以下异常
PHP Fatal error: Uncaught exception 'Elastica\Exception\Bulk\ResponseException' with message 'Error in one or more bulk request actions:
index: /en_search/en_msg/936 caused MapperParsingException[failed to parse, document is empty]
' in /root/search/vendor/ruflin/elastica/lib/Elastica/Bulk.php:395
Stack trace:
#0 /root/search/vendor/ruflin/elastica/lib/Elastica/Bulk.php(345): Elastica\Bulk->_processResponse(Object(Elastica\Response))
#1 /root/search/vendor/ruflin/elastica/lib/Elastica/Client.php(284): Elastica\Bulk->send()
#2 /root/search/vendor/ruflin/elastica/lib/Elastica/Index.php(147): Elastica\Client->addDocuments(Array)
#3 /root/search/vendor/ruflin/elastica/lib/Elastica/Type.php(187): Elastica\Index->addDocuments(Array)
#4 /root/search/setData.php(36): Elastica\Type->addDocuments(Array)
#5 {main}
thrown in /root/search/vendor/ruflin/elastica/lib/Elastica/Bulk.php on line 395
array(
[id] => 936
[uid] => 3222
[msid] => 211
[login] => user1222
[msg] => Wouldn’t you love a cup right now?
)
$mapping->setProperties(array(
'id' => array('type' => 'integer', 'include_in_all' => true),
'uid' => array('type' => 'integer', 'include_in_all' => true),
'msid' => array('type' => 'integer', 'include_in_all' => true),
'login' => array('type' => 'string', 'include_in_all' => TRUE),
'msg' => array('type' => 'string', 'include_in_all' => true),
));
’
字符引起的。不知道是否需要转义。万一我该如何逃脱此类字符?
最佳答案
解决了 。这是一个编码问题。我的数据来自mysql服务器,我必须在pdo对象初始化期间设置正确的charset选项。
关于php - 索引编制期间Elasticsearch MapperParsingException [无法解析,文档为空],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24717001/
假设您有一个无法清晰呈现的 R markdown 文档。 我知道您可以将 knitr block 选项 error 设置为 TRUE 以请求继续评估,即使存在错误也是如此。您可以通过 error =
我是一名优秀的程序员,十分优秀!