I am getting product ids from external product search system. I need them to be the result of search done through CatalogSearch.
I thought of adding a filter to searchCriteria in _renderFiltersBefore() function located in
$this->filterBuilder->setField('entity_id'); $this->filterBuilder->setValue([1,2,24]); // <-- product ids $this->searchCriteriaBuilder->addFilter($this->filterBuilder->create());
but it doesn't seem there's a filter that could select products by ids.
I have also found addIdFilter($productId, $exclude = false) function in
but can't find a way to make use of it in CatalogSearch.