Skip to content

How to correctly setup a fulltext filter in Admin Grid? (exam question)

A third-party vendor has developed a module to add blogging
functionality to Adobe Commerce. The module creates a new database
table to store the blog posts and includes an Admin grid to display
the list of all posts.

Which action, at a minimum, would an Adobe Commerce developer take in
order to add a search component to the grid that searches the contents
of the post_content column?

A. Add a <filterSearch name="fulltext"/> and create a fulltext index
for the post_content column in the database table.

B. Add a <filterSearch name="fulltext"/> node to the <column name="post_content"> node.

C. Add a <filterSearch name="fulltext"/> node to the grid’s
<listingToolbar> node.

This is an AD0-E725 practice exam question and Adobe’s “correct” answer is C.

But I think A is the correct answer.

I created a custom Admin Grid and did not set any fulltext index column.
When I search and debug, the final query was

SELECT `main_table`.* FROM `my_table` AS `main_table` ORDER BY id DESC LIMIT 20

, which returns all rows.

Then I added fulltext index column post_content to database, now the query became

SELECT `main_table`.* FROM `my_table` AS `main_table`
WHERE (((MATCH(`main_table`.`post_content`) AGAINST('the_keyword')))) ORDER BY id DESC LIMIT 20

, which returns expected result.

My question is Is Adobe's answer wrong?