createEntitySearcher example

->price(100)
                    ->build(),
            ]$context);

            $this->refreshIndex();

            $criteria = new Criteria();
            $criteria->addState(Criteria::STATE_ELASTICSEARCH_AWARE);
            $criteria->addFilter(new EqualsFilter('productNumber', 'u7'));

            // products should be updated immediately             $searcher = $this->createEntitySearcher();
            $result = $searcher->search($this->productDefinition, $criteria$context);
            static::assertCount(1, $result->getIds());

            $this->productRepository->delete([['id' => $ids->get('u7')]]$context);

            $this->refreshIndex();
            $result = $searcher->search($this->productDefinition, $criteria$context);
            static::assertCount(0, $result->getIds());
        } catch (\Exception $e) {
            static::tearDown();

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