74 foreach ($documents as $document) {
77 $document->getCustomAttribute(
'score')->getValue(),
81 return $this->populateTemporaryTable($this->createTemporaryTable(),
$data);
95 $this->getConnection()->insertArray(
116 $table = $this->createTemporaryTable();
117 $this->getConnection()->query($this->getConnection()->insertFromSelect(
$select,
$table->getName()));
126 private function getConnection()
128 return $this->resource->getConnection();
137 private function createTemporaryTable()
140 $tableName = $this->resource->getTableName(str_replace(
'.',
'_', uniqid(self::TEMPORARY_TABLE_PREFIX,
true)));
142 if ($this->config->get(
'db/connection/indexer/persistent')) {
146 self::FIELD_ENTITY_ID,
149 [
'unsigned' =>
true,
'nullable' =>
false,
'primary' =>
true],
156 [
'unsigned' =>
true,
'nullable' =>
false],
159 $table->setOption(
'type',
'memory');
storeDocumentsFromSelect(Select $select)
storeApiDocuments($documents)
__construct(\Magento\Framework\App\ResourceConnection $resource, DeploymentConfig $config=null)
const TEMPORARY_TABLE_PREFIX
storeDocuments($documents)