Magento – Understanding data_index Column in catalogsearch_fulltext Table

catalogsearch

How magento is filling the entries in column data_index and what are those values in the catalogsearch_fulltext table?

After re-indexation does this table gets updated, if yes then how and what changes are done in the table.

Best Answer

I investigated and dig into the code. Below is the brief of my findings

When we are creating the search indexes by performing catalog search re-indexation, Magento update the table catalogsearch_fulltext with the product id and data_index. data_index contains the values of all the searchable attributes of the product itself and the associated products like brand, name, etc but it contains the sku only of the product and not of the associated product.

So, when a user is searching with a particular text, then magento tries to match this text with the values present in the data_index. If it gets any matching text then it shows that particular product in the result set.

Example values of data_index : AB2180|AB2180 Polished/Brushed|AB2180 Polished Chrome|AB2180 Brushed Nickel|||||1 Brief of above values : AB2180 : product sku AB2180 Polished/Brushed : product name AB2180 Polished Chrome|AB2180 Brushed Nickel : associated product names

Below are the table and files that helped me to understand

Database Table : catalogsearch_fulltext

CodeFiles or classes :

 - Mage_CatalogSearch_Model_Resource_Fulltext
 - Mage_CatalogSearch_Model_Resource_Fulltext_Engine