1

I need to allow to use numbers in quick search to differentiate products that are called like this examples :

  • box 1800
  • box 1100
  • box 5500

But it looks like the numbers are ignored in the search. Do you know how to fix this problem?

1 Answer 1

2

Magento uses MATCH AGAINST in it's SQL query used for searching products in Fulltext mode.

Most probably your configuration is set to fulltext (it's done in: Admin > Catalog > Catalog Search and find Search Type) and your MySQL server is configured with ft_min_word_len higher than 4.

To check the default configuration login to MySQL and type in:

mysql> show variables like 'ft%';
+--------------------------+----------------+
| Variable_name            | Value          |
+--------------------------+----------------+
| ft_boolean_syntax        | + -><()~*:""&| |
| ft_max_word_len          | 84             |
| ft_min_word_len          | 4              |
| ft_query_expansion_limit | 20             |
| ft_stopword_file         | (built-in)     |
+--------------------------+----------------+
5 rows in set (0.00 sec)

mysql>

To change this value open up your MySQL config (e.g. /etc/my.cnf) and search for/change line to:

ft_min_word_len = 1 where 1 is the minimum length of word

Restart your MySQL server: service mysql restart

Reindex data in Magento.

Second solution is to rewrite class Mage_CatalogSearch_Model_Resource_Fulltext and in function prepareResult:330 add code block that would handle words shorter than 5 characters with LIKE statement.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.