Skip to main content

Installation

Before we begin, please ensure that you have a backup of your data before proceeding with the installation of the extension. This is because although we will make our best to support you, we cannot take responsibility of any data loss that might occur during the installation of this extension.

Installation steps - Weaviate with Docker:

  1. Unpack the Mexbs_AISearch_v1.1.0.zip file.
  2. SSH to your server.
  3. Install docker and docker compose on you server.
  4. Create a directory where the docker compose project will sit. For example /root/docker
  5. Go to /root/docker and extract the contents of Mexbs_AISearch_v1.1.0/weaviate.tgz into it, so you will get the /root/docker/weaviate directory, with docker-compose.yaml and other files into it.
  6. Go to /root/docker/weaviate and run:
docker compose up --build -d

That will start the Weaviate (AI search engine), and the Python server. To make sure that it started run:

docker ps

If it says that the image is restarting or has an error, you can run:

docker logs <container name>

Installation steps - Magento extension:

  1. Connect via SSH and go to your Magento root directory
  2. Determine the mode that your Magento is running on, by running the following command:
php bin/magento deploy:mode:show
  1. If you are in developer or default mode, run the following commands:
php bin/magento module:enable Mexbs_AISearch Mexbs_AISearchEngine --clear-static-content
php bin/magento setup:upgrade
  1. Run:
php bin/magento setup:static-content:deploy -f
  1. If you are in production mode, run the following commands:
php bin/magento module:enable Mexbs_AISearch Mexbs_AISearchEngine --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
  1. Go to the admin panel – Stores->Configuration->General->AI Search Settings” and set "Enable AI Search" to "Yes", "Search Server Address" to "http://localhost:5000". Save the settings.
  2. Go to Stores->Configuration->Catalog->Catalog->Catalog Search and set "Search Engine" to "AISearchEngine". Keep the other setting the same as before ("AISearchEngine Server Hostname" to "localhost", "AISearchEngine Server Port" to "9200", "AISearchEngine Index Prefix" to "magento2", "Enable AISearchEngine HTTP Auth" to "No", and "AISearchEngine Server Timeout" to "15").
  3. Go to the admin panel – “System->Cache Management” and click “Flush Magento Cache”.
  4. Make sure that you have Open search or Elastic search enabled and running (The extension code is based on the Magento Elasticsearch library, which can be using either Open search or Elastic search server).
  5. Run the reindex command in your SSH:
php bin/magento indexer:reindex
  1. Run the following command in your SSH:
bin/magento ai-search:index

You should get an output similar to the following:

Clearing existing index...
Response: {"message":"index cleared","status":"ok"}
Indexed 50 products (page 1 out of 4)
Indexed 50 products (page 2 out of 4)
Indexed 50 products (page 3 out of 4)
Indexed 30 products (page 4 out of 4)
All products indexed successfully.
  1. Go to the admin panel – “System->Cache Management” and click “Flush Magento Cache”.
  2. Now, try going to any page in your website and try typing a search term in the search box. You should see the following:

A search autocomplete drop down shows up under the search box