0

I've added custom product text attribute and marked it "Use In Search".

Also my code configured for searching by two letters.

For example when I'm searching "Tuborg" and typing "tu" autocomplete in search bar show me results.

In my atribute I added short word "øl" which means beer in norwegian. As you can see whe word contains one letter from extended latin list.

Typing exactly that word in search bar result gives me nothing. Some experiments shows me that if I write attribute value "øle" instead "øl" and type "øl" in search bar - it gives me result of needed product.

How to make working search by this kind of two words? And why it isn't working?

UPD: As I though the problem might be in norwegian entities, but search doesn't work in general in case when word contain only two letters and search query contain two letters too.

1
  • I think you need to customized the auto complete code and have to see what logics they are using and creating query to get the desired result. then use the resulted query and hit it directly to mysql and check what error you get. You can also google for searching for special symbols or can you %like% Commented Jan 31, 2017 at 10:29

2 Answers 2

2

No need to customized core file that's is not good idea, There are following free and paid extensions, Please install and configure as per your requirements, Hope It's helpful for you.It's only work for Magento 1.9.x, Please contact developer they will provide you update version for Magento 2

https://www.magentocommerce.com/magento-connect/search-autocomplete-search-suggest.html

https://www.magentocommerce.com/magento-connect/ajax-search-and-autocomplete-extension-for-magento.html

https://www.magentocommerce.com/magento-connect/search-autocomplete-and-suggest-2.html

1

Issue was in mysql settings.

Added this params to my.ini:

[mysqld]
ft_min_word_len=2
innodb_ft_min_token_size=2

Then according to official mysql documentation https://dev.mysql.com/doc/refman/5.7/en/fulltext-fine-tuning.html the fulltext index need to be rebuilded. This should affect two tables in my case (found out this experimentally) 'catalogsearch_fulltext_scope1' and 'catalog_eav_attribute'.

ALTER TABLE `mat24`.`catalogsearch_fulltext_scope1` DROP PRIMARY KEY, ADD PRIMARY KEY (`entity_id`, `attribute_id`) USING BTREE;
ALTER TABLE `mat24`.`catalogsearch_fulltext_scope1` DROP INDEX `FTI_FULLTEXT_DATA_INDEX`, ADD FULLTEXT `FTI_FULLTEXT_DATA_INDEX` (`data_index`);
ALTER TABLE `mat24`.`catalog_eav_attribute` DROP PRIMARY KEY, ADD PRIMARY KEY (`attribute_id`) USING BTREE;
ALTER TABLE `mat24`.`catalog_eav_attribute` DROP INDEX `CATALOG_EAV_ATTRIBUTE_USED_IN_PRODUCT_LISTING`, ADD INDEX `CATALOG_EAV_ATTRIBUTE_USED_IN_PRODUCT_LISTING` (`used_in_product_listing`) USING BTREE;
ALTER TABLE `mat24`.`catalog_eav_attribute` DROP INDEX `CATALOG_EAV_ATTRIBUTE_USED_FOR_SORT_BY`, ADD INDEX `CATALOG_EAV_ATTRIBUTE_USED_FOR_SORT_BY` (`used_for_sort_by`) USING BTREE;

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.