mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
PHRAS-3023_slow-query-while-indexing_4.1
- fix bound limit depending on order/direction options - add index on dbox:record.moddate
This commit is contained in:
@@ -38,7 +38,7 @@ class ElasticsearchOptions
|
||||
/** @var string */
|
||||
private $populateDirection;
|
||||
|
||||
/** @var int[] */
|
||||
/** @var int[][] */
|
||||
private $_customValues = [];
|
||||
private $activeTab;
|
||||
|
||||
@@ -437,15 +437,9 @@ class ElasticsearchOptions
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPopulateOrderAsSQL()
|
||||
public function getPopulateOrder()
|
||||
{
|
||||
static $orderAsColumn = [
|
||||
self::POPULATE_ORDER_RID => "`record_id`",
|
||||
self::POPULATE_ORDER_MODDATE => "`moddate`",
|
||||
];
|
||||
|
||||
// populateOrder IS one of the keys (ensured by setPopulateOrder)
|
||||
return $orderAsColumn[$this->populateOrder];
|
||||
return $this->populateOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -465,6 +459,14 @@ class ElasticsearchOptions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPopulateDirection()
|
||||
{
|
||||
return $this->populateDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -474,4 +476,4 @@ class ElasticsearchOptions
|
||||
return $this->populateDirection;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user