我正在使用elasticsearch。我要创建新的、更新的、删除的子文档。
对于父文档,我可以使用
$Params = array();
$Params ['index'] = 'vision';
$Params ['type'] = 'type';
$Params ['id'] = 1590353;
$Params ['body']['doc'] = array('field' => 'value');
$retUpdate = $client->update($Params );但是对于子文档,我总是会出错。
{"error":"RoutingMissingException[routing is required for [vision]/[child_type]/[1590354]]","status":400}我该怎么做呢?
我想那是因为路由
通过父程序,我可以访问URL:localhost:9200/vision/mt_customer/1590354?pretty
但是,当访问子文档:localhost:9200/vision/child_type/12314?pretty时,我得到了错误的路由选择
发布于 2014-08-08 06:44:50
刚刚发现了问题。对于子文档,我们需要将父文档添加到索引中。
示例:
$searchParams['index'] = 'vision';
$searchParams['type'] = 'child_type';
$searchParams['id'] = 156728;
$searchParams['parent'] = 1791035;https://stackoverflow.com/questions/25195900
复制相似问题