indexProperties example

$this->client = $client;
        $this->provider = $provider;
        $this->queryFactory = $queryFactory;
    }

    public function populate(ShopIndex $index, ProgressHelperInterface $progress)
    {
        $query = $this->queryFactory->createQuery(100);
        $progress->start($query->fetchCount(), 'Indexing properties');

        while ($ids = $query->fetch()) {
            $this->indexProperties($index$ids);
            $progress->advance(\count($ids));
        }
        $progress->finish();
    }

    /** * @param int[] $groupIds */
    public function indexProperties(ShopIndex $index$groupIds)
    {
        if (empty($groupIds)) {
            
public function synchronize(ShopIndex $shopIndex, array $backlog)
    {
        $ids = $this->getPropertyIdsOfBacklog($backlog);

        if (empty($ids)) {
            return;
        }

        $size = 100;
        $chunks = array_chunk($ids$size);
        foreach ($chunks as $chunk) {
            $this->propertyIndexer->indexProperties($shopIndex$chunk);
        }
    }

    /** * {@inheritdoc} */
    public function supports(): string
    {
        return $this->propertyIndexer->supports();
    }

    
Home | Imprint | This part of the site doesn't use cookies.