public function reindexByActiveQuery(ActiveQueryInterface $activeQuery)
    {
        $indices = null;
        $records = $this->activeQueryChunker->chunk(
            $activeQuery,
            self::CHUNK_SIZE,
            function ($activeRecordEntities) use (&$indices) {
                $records = $this->getAlgoliaRecordsFromSearchableModelArray($activeRecordEntities);

                // The converting ActiveRecords to Algolia ones already does the type checking
                // so it's safe to init indices here during the first chunk.
                if ($indices === null) {
                    $indices = $this->initIndices($activeRecordEntities[0]);
                }

                return $records;
            }
        );

        return $this->processIndices($indices, function (Index $index) use ($records) {
            return $this->reindexAtomically($index, $records);
        });
    }
public function reindexByActiveQuery(ActiveQueryInterface $activeQuery)
    {
        $indices = null;
        $records = $this->activeQueryChunker->chunk(
            $activeQuery,
            self::CHUNK_SIZE,
            function ($activeRecordEntities) use (&$indices) {
                $records = $this->getAlgoliaRecordsFromSearchableModelArray($activeRecordEntities);

                // The converting ActiveRecords to Algolia ones already does the type checking
                // so it's safe to init indices here during the first chunk.
                if ($indices === null) {
                    $indices = $this->initIndices($activeRecordEntities[0]);
                }

                return $records;
            }
        );

        return $this->processIndices($indices, function (Index $index) use ($records) {
            return $this->reindexAtomically($index, $records);
        });
    }
public function reindexByActiveQuery ( ActiveQueryInterface $ activeQuery ) { $ indices = null ; $ records = $ this -> activeQueryChunker -> chunk ( $ activeQuery , self :: CHUNK_SIZE , function ( $ activeRecordEntities ) use ( & $ indices ) { $ records = $ this -> getAlgoliaRecordsFromSearchableModelArray ( $ activeRecordEntities ) ; // The converting ActiveRecords to Algolia ones already does the type checking // so it's safe to init indices here during the first chunk. if ( $ indices === null ) { $ indices = $ this -> initIndices ( $ activeRecordEntities [ 0 ] ) ; } return $ records ; } ) ; return $ this -> processIndices ( $ indices , function ( Index $ index ) use ( $ records ) { return $ this -> reindexAtomically ( $ index , $ records ) ; } ) ; }
Re-indexes the related indices for the given ActiveQueryInterface.
The result of the given ActiveQuery must consist from Searchable models of the same class.

@param ActiveQueryInterface $activeQuery

@return array
Re - indexes the related indices for the given ActiveQueryInterface . The result of the given ActiveQuery must consist from Searchable models of the same class .