0

Magento2 : How to add a full-text search query in a block's function within a custom module?

This is what I am trying so far:

    $postCollection->addFieldToSelect('*');
    if($search != '') {
    $array = explode(' ', $search); 
    $se=[];
    foreach($array as $ar){
      array_push($se,array('like' => '%' . $ar . '%'));
    }
    $postCollection->addFieldToFilter('recipes_title',$se);

I want to remove like query and replace it with a full-text query. Is it possible?

Anyone help me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.