public function indexScheduled(BulkOperation $bulk, databox $databox)
    {
        $submitted_records = [];

        // Make fetcher
        $delegate = new ScheduledFetcherDelegate();
        $fetcher = $this->fetcherFactory->createFetcher($databox, $delegate);

        // post fetch : flag records as "indexing"
        $fetcher->setPostFetch(function(array $records) use ($databox, $fetcher) {
            $this->logger->debug(sprintf("indexing %d records", count($records)));
            RecordQueuer::didStartIndexingRecords($records, $databox);
            // because changing the flag on the records affects the "where" clause of the fetcher,
            // restart it each time
            $fetcher->restart();
        });

        // bulk flush : flag records as "indexed"
        $bulk->onFlush(function($operation_identifiers) use ($databox, &$submitted_records) {
            $this->onBulkFlush($databox, $operation_identifiers, $submitted_records);
        });

        // Perform indexing
        $this->indexFromFetcher($bulk, $fetcher, $submitted_records);
    }
public function indexScheduled(BulkOperation $bulk, databox $databox)
    {
        $submitted_records = [];

        // Make fetcher
        $delegate = new ScheduledFetcherDelegate();
        $fetcher = $this->fetcherFactory->createFetcher($databox, $delegate);

        // post fetch : flag records as "indexing"
        $fetcher->setPostFetch(function(array $records) use ($databox, $fetcher) {
            $this->logger->debug(sprintf("indexing %d records", count($records)));
            RecordQueuer::didStartIndexingRecords($records, $databox);
            // because changing the flag on the records affects the "where" clause of the fetcher,
            // restart it each time
            $fetcher->restart();
        });

        // bulk flush : flag records as "indexed"
        $bulk->onFlush(function($operation_identifiers) use ($databox, &$submitted_records) {
            $this->onBulkFlush($databox, $operation_identifiers, $submitted_records);
        });

        // Perform indexing
        $this->indexFromFetcher($bulk, $fetcher, $submitted_records);
    }
public function indexScheduled ( BulkOperation $ bulk , databox $ databox ) { $ submitted_records = [ ] ; // Make fetcher $ delegate = new ScheduledFetcherDelegate ( ) ; $ fetcher = $ this -> fetcherFactory -> createFetcher ( $ databox , $ delegate ) ; // post fetch : flag records as "indexing" $ fetcher -> setPostFetch ( function ( array $ records ) use ( $ databox , $ fetcher ) { $ this -> logger -> debug ( sprintf ( "indexing %d records" , count ( $ records ) ) ) ; RecordQueuer :: didStartIndexingRecords ( $ records , $ databox ) ; // because changing the flag on the records affects the "where" clause of the fetcher, // restart it each time $ fetcher -> restart ( ) ; } ) ; // bulk flush : flag records as "indexed" $ bulk -> onFlush ( function ( $ operation_identifiers ) use ( $ databox , & $ submitted_records ) { $ this -> onBulkFlush ( $ databox , $ operation_identifiers , $ submitted_records ) ; } ) ; // Perform indexing $ this -> indexFromFetcher ( $ bulk , $ fetcher , $ submitted_records ) ; }
Index the records flagged as "to_index" on databox
called by task "indexer"

@param BulkOperation $bulk
@param databox $databox
Index the records flagged as to_index on databox called by task indexer