I am just trying to filter product collection same like catalog search module, but not couldn't get the succeed with this. For this I tried this,
use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection as SearchColletion;
$collection = $this->searchCollection->addSearchFilter('MY CUSTOM TEXT');
For this I checked vendor\magento\module-catalog-search\Model\ResourceModel\Fulltext\Collection.php
to Investigate how it actual works in Magento catalog search, and found that in _renderFiltersBefore()
Magento is using filterBuilder
, searchCriteriaBuilder
and so many things for searching, but couldn't understand properly.
Can someone put some light on this to get the actual result?