How to enable Full Text search in admin grid of magento2

To enable fulltext search for custom grid you need to create fulltext index in your grid table. fulltext filter scans indexes list and builds query with fulltext condition only if index exists.

See example, how fulltext filter works, for Merchant Beta, Mainline


TO make full text search or keyword search of admin grid you need to make or add index of the table

$connection->addIndex(
                    'testtable', //table name
                    'title',    // index name
                    [
                        'title'   // filed or column name 
                    ],
                    \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_FULLTEXT //type of index
                );

Thank you @anton


To make fulltext search work in magento 2 admin listing/grid you need to:

  1. Add index to the table you use for storing your listing/grid data
  2. Add addFilter method to you grid/listing DataProvider that calls it's collections addFieldToFilter or addAttributeToFilter method
  3. In your component xml file you can use just <filterSearch name="fulltext"/> node without description in listingToolbar