TransWikia.com

Magento 2: Adding full text search to custom grid results in error on count query

Magento Asked by fakhan2k on December 26, 2021

I am trying to add full text search to a custom grid.
I have done the following steps

  • added full text indexes to related columns in the table
  • in the ui component xml file, added <filterSearch name="fulltext"/> node (tried with and without description)

The search bar appears on the grid page, but when I search for something I get the following error in exception log

[2020-07-24 10:05:59] report.CRITICAL: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fulltext' in 'where clause', query was: SELECT COUNT(*) FROM `aw_helpdesk_ticket` AS `main_table`
 INNER JOIN `aw_helpdesk_ticket_grid_flat` AS `flat` ON main_table.id = flat.ticket_id
 INNER JOIN `aw_helpdesk_department` AS `department` ON main_table.department_id = department.id WHERE (((`department_id` = '1'))) AND (((`fulltext` = 'test'))) {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fulltext' in 'where clause', query was: SELECT COUNT(*) FROM `aw_helpdesk_ticket` AS `main_table`
 INNER JOIN `aw_helpdesk_ticket_grid_flat` AS `flat` ON main_table.id = flat.ticket_id
 INNER JOIN `aw_helpdesk_department` AS `department` ON main_table.department_id = department.id WHERE (((`department_id` = '1'))) AND (((`fulltext` = 'test'))) at /Users/fkhan/Sites/TPM2/app/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:110, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fulltext' in 'where clause' at /Users/fkhan/Sites/TPM2/app/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91)"} []

One Answer

make sure in your ui component file dataProvider element is exist and is proper as

<dataProvider class="MagentoFrameworkViewElementUiComponentDataProviderDataProvider" name="answer_listing_data_source">
            <settings>
                <requestFieldName>answer_id</requestFieldName>
                <primaryFieldName>answer_id</primaryFieldName>
            </settings>
        </dataProvider>

Answered by Yash Bhayani on December 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP