cancel
Showing results for 
Search instead for 
Did you mean: 

Elasticsearch and Autocomplete

Elasticsearch and Autocomplete

I have a Magento 2.4 instance running on the Bitnami virtual machine platform with the Porto theme installed that includes the Mageplaza search extension and am unable to work out why the search auto complete is not working.

I have imported 1000 products which are set as in stock and have a quantity of 1 so should be suggested when adding the characters in the search box.

 

The auto suggestions work if a search term is stored in SEO & Search.

I have run the indexer:reindex catalogsearch_fulltext command, indexer:reindex and cleared cache.

The Apache logs show 

"GET /search/ajax/suggest/?q=123&_=1604587446133 HTTP/1.1" 200 2

but no suggestions are shown.

 

I do have an error in the Magento exception log but don't know if it is related to the problem.

main.CRITICAL: Cannot gather stats! Warning!stat(): stat failed for /opt/bitnami/apps/magento/htdocs/pub/static/frontend/Smartwave/porto_child/en_GB/mage/requirejs/mixins.js {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Cannot gather stats! Warning!stat(): stat failed for /opt/bitnami/apps/magento/htdocs/pub/static/frontend/Smartwave/porto_child/en_GB/mage/requirejs/mixins.js at /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Filesystem/Driver/File.php:77)"} []

I have tried to disable the Mageplaza search module but there is no change.

How do I debug this problem as I have run out of ideas.

 

Thanks

1 REPLY 1

Re: Elasticsearch and Autocomplete

I had this problem and the below worked for me

I have just fixed this problem.

it was nothing to do with Pearl(a theme), we are quite sure it is because of some legacy attributes that did not work with elastic search.
The site was a Magento 1 site and back then I used attributes to assist with the menus pre Mega Menu

Our checking process was to disable Ajax (didnt work), reinstall Ajax(didnt work) change to default theme (didnt work), change attributes to non searchable not all of them just the ones that did not need to be searchable (worked)