cleanupIndexSearchIndex example

/** * POST /api/customer_streams * POST /api/customer_streams?buildSearchIndex=1 */
    public function postAction(): void
    {
        $request = $this->Request();

        if ($request->has('buildSearchIndex')) {
            $this->resource->buildSearchIndex(0, true);
            $this->resource->cleanupIndexSearchIndex();
            $this->View()->assign(['success' => true]);

            return;
        }

        $stream = $this->resource->create(
            $request->getPost(),
            $request->getParam('indexStream')
        );

        $location = $this->apiBaseUrl . 'customer_streams/' . $stream->getId();
        
$offset = ($iteration - 1) * CustomerStreamRepository::INDEXING_LIMIT;
        $handled = $offset + CustomerStreamRepository::INDEXING_LIMIT;

        $full = $this->Request()->getParam('full');

        $ids = $this->getApiResource()->buildSearchIndex($lastId$full);

        $snippets = $this->container->get('snippets')->getNamespace('backend/customer/view/main');

        if ($handled >= $total) {
            $this->getApiResource()->cleanupIndexSearchIndex();

            $this->View()->assign([
                'success' => true,
                'finish' => true,
                'progress' => 1,
                'text' => $snippets->get('customer_refreshed'),
            ]);

            return;
        }

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