Skip to content
Commits on Source (2)
......@@ -108,7 +108,7 @@ class ElasticRepository
$sort = ['@timestamp' => 'asc'];
}
if ($opts['state'] === 'approved' || $opts['state'] === 'review') {
if ($opts['state'] === 'approved' || $opts['state'] === 'review' || $opts['state'] === 'active') {
$must_not[] = [
'exists' => [
'field' => '@completed',
......
......@@ -57,14 +57,14 @@ class Manager
'state' => null,
], $opts);
if ($opts['state'] == 'review') {
if ($opts['state'] == 'review' || $opts['state'] == 'active') {
$opts['useElastic'] = true;
}
if ($opts['useElastic']) {
$response = $this->elasticRepository->getList($opts);
if ($opts['state'] === 'review') {
if ($opts['state'] === 'review' || $opts['state'] === 'active') {
$opts['guids'] = array_map(function ($boost) {
return $boost->getGuid();
}, $response->toArray());
......@@ -200,6 +200,7 @@ class Manager
public function getOffchainBoosts($boost, $limit = 10) {
$existingBoosts = $this->getList([
'useElastic' => true,
'state' => 'active',
'type' => $boost->getType(),
'limit' => $limit,
'order' => 'desc',
......
......@@ -303,7 +303,7 @@ class ManagerSpec extends ObjectBehavior
$this->elasticRepository->getList([
"hydrate" => true,
"useElastic" => true,
"state" => "review",
"state" => "active",
"type" => "newsfeed",
"limit" => 10,
"order" => "desc",
......@@ -375,7 +375,7 @@ class ManagerSpec extends ObjectBehavior
$this->elasticRepository->getList([
"hydrate" => true,
"useElastic" => true,
"state" => "review",
"state" => "active",
"type" => "newsfeed",
"limit" => 10,
"order" => "desc",
......