Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problem: No search results w/ Fulltext & query length <= 3
 
abatardi
Jr. Member
 
Total Posts:  8
Joined:  2008-02-29
 

I am using “Fulltext” search type and noticed that the standard search returns no results for any query 3 characters or less (advanced search returns results) This is a problem for my store because I actually carry several brands and products with 2 or 3 letters that people are searching for and don’t want to setup redirects or synonyms for every one.

Is there any way to fix this w/o switching to like/combined (which do show results for queries <= 3 chars)?  It is obvious the search is not even being performed, it is just immediately comes back saying no results… but I can’t seem to find in the code the condition where it is checking the query length and stopping the search for fulltext type.

Any assistance would be appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
d41m
Jr. Member
 
Total Posts:  16
Joined:  2009-01-07
 

MySQL’s default minimum number for characters for words in a fulltext search index is 4.

To make it 3, add the following to your my.cnf and restart MySQL.

ft_min_word_len=3

Then rebuild the fulltext index on the ‘catalogsearch_fulltext’ table. You can do this with the following command:

repair table catalogsearch_fulltext quick;

Then rebuild your search index from System->Cache Management in Magento Admin

...and you are good to go grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
abatardi
Jr. Member
 
Total Posts:  8
Joined:  2008-02-29
 

wow, thank you so much.  almost a year later had given up on finding a solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
caiohn
Jr. Member
 
Total Posts:  7
Joined:  2008-08-20
 

Hey there,
since the post is live again, I have a problem that I have been struggling for days and can’t figure it out.

I created a script to import/update products, but since I receive lots of records per minute, I had to give up using the webservices or Magento APIs. I am writing directly into MySQL product, stock and catalog search tables.

Product is being added fine, I can see it using the direct url (http://<host>/index.php/<url_path>) and also under the category that is being passed. Problem is, I cannot find it under Search or Advanced Search by any means.

I am creating a record in `catalogsearch_fulltext` table with Product Title and SKU, exactly in the same way that older products are recorded and ‘foundable’ through both Search modes. But still can’t find it, even after rebuilding search indexes.

These are all the tables that I am inserting information about the product:

catalog_product_entity
catalog_product_entity_int
catalog_product_entity_decimal
catalog_product_entity_text
catalog_product_entity_varchar

cataloginventory_stock_item
cataloginventory_stock_status
catalog_product_website

catalog_category_product
catalog_category_product_index

core_url_rewrite

catalogsearch_fulltext

I can’t see anywhere else that a product info is stored and could bring me the new product result after I search for it.

Does anyone know what I am doing wrong?
Or, at least, show me the path to debug the search module so I can understand why it is looking for something that is in `catalogsearch_fulltext` table and not bringing any result?

Thanks in advance!!!

Caio

 
Magento Community Magento Community
Magento Community
Magento Community
 
mgatchis
Jr. Member
 
Total Posts:  20
Joined:  2009-05-06
 
d41m - 26 January 2010 02:11 AM

MySQL’s default minimum number for characters for words in a fulltext search index is 4.

To make it 3, add the following to your my.cnf and restart MySQL.

ft_min_word_len=3

Then rebuild the fulltext index on the ‘catalogsearch_fulltext’ table. You can do this with the following command:

repair table catalogsearch_fulltext quick;

Then rebuild your search index from System->Cache Management in Magento Admin

...and you are good to go grin

FIXED!!

Thank you so much!  I skipped the step: “ft_min_word_len=3” and just did the table repair.  Worked fine.  As for those who are currently having this issue, I am using 1.4.1 so give it a shot and see what happens.

Boo ya ka sha!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mgatchis
Jr. Member
 
Total Posts:  20
Joined:  2009-05-06
 

Oh.. and for those of you who are wondering as to where to do this, go into your SQL manager (phpMyAdmin for me), select the table, select the ‘catalogsearch_fulltext’ table and then click the SQL tab.  Copy that line into the “Run Query” field box and then click GO.  This should fix you right up as it did me. 

I was a beginner at one point too.  Thought I would help those of you save some time.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jerry Guo
Sr. Member
 
Total Posts:  85
Joined:  2008-08-18
china
 
d41m - 26 January 2010 02:11 AM

MySQL’s default minimum number for characters for words in a fulltext search index is 4.

To make it 3, add the following to your my.cnf and restart MySQL.

ft_min_word_len=3

Then rebuild the fulltext index on the ‘catalogsearch_fulltext’ table. You can do this with the following command:

repair table catalogsearch_fulltext quick;

Then rebuild your search index from System->Cache Management in Magento Admin

...and you are good to go grin

Thank you so much! I solved the search problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pbirnie
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2012-05-10
 

One more contribution to this:

We were having problems with searches like “Get Well"… I this case, both words are on MySQLs stop words list and you have to edit stop words list file:

http://stackoverflow.com/questions/4685252/where-to-edit-mysql-fulltext-stopword-lists

Did not know about this…

http://dev.mysql.com/doc/refman/5.5/en//fulltext-stopwords.html

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top