由于我从2.4移到5.6,使用滚动查询时出错:
$query = '{
"scroll" : "1m",
"scroll_id" : "'. $scrollId .'"
}';
$path = '/_search/scroll';
$responseArray = $this->sendQuery($index, $path, Request::GET, $query);
错误:
CRITICAL - 未捕获的PHP异常Elastica \ Exception \ ResponseException:"没有这样的索引[index:]" at /code/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php第179行
这是我使用的初始查询:
$path = 'dataIndex/_search?scroll=1m';
$query = sprintf(
'{
"size" : 500,
"stored_fields": "_source"
}'
);
我如何调用我的滚动功能
$hits = $this->getElasticNextScroll($this->dataIndex, $hits['_scroll_id']);
我尝试的解决方案之一是使用POST发送请求,但我收到了另一个错误:
CRITICAL - 未捕获的PHP异常Elastica \ Exception \ ResponseException:"字符串索引超出范围:0" at /code/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php第179行
编辑解决方案:
路径' / _ search / scroll'在2.4工作,但在5.3中不再工作。你需要删除第一个/:' _search / scroll'
答案 0 :(得分:0)
指定传递给$ index的值以及Request :: GET函数中包含的内容
答案 1 :(得分:0)
Index {#9208
-originalName: null
-typeCache: []
#_name: "index_data"
#_client: Client {#9234
-indexCache: array:1 [
"index_data" => Index {#9208}
]
-stopwatch: Stopwatch {#157
...
这里是我的堆栈错误:
[1] Elastica \ Exception \ ResponseException:在/code/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php第179行中没有这样的索引[index:]在n / a
at Elastica \ Transport \ Http-> exec(object(Request),array('connection'=> array('config'=> array('headers'=> array(),'curl' => array()),'host'=>'127.0.0.1','port'=>'9200','logger'=> false,'ssl'=> false,'compression'=在&code/vendor/ruflin/elastica/lib/Elastica/Request.php第193行
在Elastica \ Request-> send()/ code/vendor/ruflin/elastica/lib/Elastica/Client.php第674行
在弹性曲线\客户端 - >请求( '/ _搜索/滚动', 'GET', '{ “滚动”: “1M”, “scroll_id”: “DnF1ZXJ5VGhlbkZldGNoBAAAAAAAAAPfFnF2VnFBRzFWU0RTaTAwVVZLSl9UU2cAAAAAAAAD3RZxdlZxQUcxVlNEU2kwMFVWS0pfVFNnAAAAAAAAA-AWcXZWcUFHMVZTRFNpMDBVVktKX1RTZwAAAAAAAAPeFnF2VnFBRzFWU0RTaTAwVVZLSl9UU2c =”}',阵列(), 'application / json')在/code/vendor/friendsofsymfony/elastica-bundle/Elastica/Client.php第50行
在FOS \ ElasticaBundle \弹性曲线\客户端 - >请求( '/ _搜索/滚动', 'GET', '{ “滚动”: “1M”, “scroll_id”: “DnF1ZXJ5VGhlbkZldGNoBAAAAAAAAAPfFnF2VnFBRzFWU0RTaTAwVVZLSl9UU2cAAAAAAAAD3RZxdlZxQUcxVlNEU2kwMFVWS0pfVFNnAAAAAAAAA-AWcXZWcUFHMVZTRFNpMDBVVktKX1RTZwAAAAAAAAPeFnF2VnFBRzFWU0RTaTAwVVZLSl9UU2c =”}')在/code/src/AppBundle/Repository/ElasticSearch/BaseElasticSearchRepository.php第22行