EN
Log in Create an account

How to set up Meilisearch on Saplo: search for your store and website

Run Meilisearch on Saplo, import your first documents, and connect search to your own website. A step-by-step guide, Box S for $29 a year.

Grzegorz Kalmus ·

A customer enters a product name with a typo and gets an empty list of results, even though the product is in the store. The same problem affects documentation and extensive content catalogs. Meilisearch lets you add typo-tolerant search to your own application. In this guide, we'll show you how to set up Meilisearch on Saplo, upload the initial data and run a search query.

What is Meilisearch and who is it for

Meilisearch is a search engine that provides a REST API. You send it selected data, and your website retrieves the results through the API. It is a good fit for a product catalog, a knowledge base, or an article service. You can find examples of its uses on the Meilisearch hosting page on Saplo.

The installation itself does not automatically connect a store or create a search form on your website. You need an integration that passes the data and displays the results. Start by planning a small, public dataset, for example the names and descriptions of several products.

Requirements and hosting cost

The cheapest plan that meets the installation requirements is Box S for $29 per year. This is a starting point for launching the service; the size of the target index, import frequency, and other applications on Box affect resource requirements. Before importing the entire catalog, check the available disk space and memory.

Prepare an active Box, an application name, and a domain or available subdomain *.saploapp.pl. For the examples below, you need a Bash terminal and curl on your own computer. You do not need SSH to Box: you will perform the installation in the panel, download the startup file via SFTP, and send queries over HTTPS.

Installation step by step

  1. Log in to the Saplo panel and open the App catalog.
  2. Select Meilisearch and start creating the application.
  3. Give it a name, for example wyszukiwarka, and select a Box with available resources.
  4. Select a Domain or subdomain. Keep the exact HTTPS address displayed in the panel.
  5. Approve the installation. Wait for it to finish and check the application status and any messages.
  6. Connect via SFTP using the Box access credentials. In the application directory, locate and download the MEILISEARCH-SETUP.txt file.

The Saplo installer runs Meilisearch in production mode and generates an admin key. The startup file contains the API address and this key. The built-in search preview familiar from developer mode is disabled, so the lack of a login panel under the main address does not indicate a failure.

First connection and admin key

In the Bash terminal on your own computer, set the address from the startup file, without a trailing slash:

MEILI_URL='https://YOUR-APP-ADDRESS'
curl -sS "$MEILI_URL/health"

The correct response is {"status":"available"}. The endpoint checks whether the engine is available, as described in the Documentation for the health check. It does not yet confirm that the data has been imported correctly.

Load the admin key without displaying it on screen or entering its value in the command history:

read -r -s -p 'Meilisearch admin key: ' MEILI_ADMIN_KEY
printf '\n'

Paste the value from the startup file and press Enter. This is a Meilisearch key, not a Saplo password. Use it only in a trusted administrative environment. Do not include it in the site's JavaScript, repository, or screenshots. The Documentation for Meilisearch keys describes the principles for separating permissions.

Adding your first documents

Create a file called products-demo.json on your computer using UTF-8:

[
  {"id": 1, "name": "Ceramic mug", "description": "White coffee mug"},
  {"id": 2, "name": "Glass jug", "description": "Tea jug"}
]

In the same terminal, navigate to the directory containing the file and run:

curl -sS -X POST "$MEILI_URL/indexes/products-demo/documents?primaryKey=id" \
  -H "Authorization: Bearer $MEILI_ADMIN_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @products-demo.json

The id field identifies the document. The first import creates the products-demo index. The response contains taskUid, which is the indexing task number. The import schema is described in the official Meilisearch quick start guide.

Checking indexing

Accepting the request does not mean the work is complete. Set the number received in the taskUid field and check the task:

MEILI_TASK_ID='WPISZ_NUMER_TASKUID'
curl -sS "$MEILI_URL/tasks/$MEILI_TASK_ID" \
  -H "Authorization: Bearer $MEILI_ADMIN_KEY"

Wait for status: succeeded. If you see enqueued or processing, check again after a moment. If you see failed, read the error field and correct the data before importing again. You can find information about the queue in the API task documentation.

A separate search key

Create a key with search permission for the sample index only:

curl -sS -X POST "$MEILI_URL/keys" \
  -H "Authorization: Bearer $MEILI_ADMIN_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{"description":"Search in the public demo catalog","actions":["search"],"indexes":["products-demo"],"expiresAt":null}'

Save the key value from the response. The restriction to products-demo is intentional: a key intended for one catalog should not expose all indexes. This key allows you to retrieve search results, so on the public front end, use it only for data intended for publication. Do not put customer data or internal notes in this index.

Load the received key and send a query:

read -r -s -p 'Meilisearch search key: ' MEILI_SEARCH_KEY
printf '\n'
curl -sS -X POST "$MEILI_URL/indexes/products-demo/search" \
  -H "Authorization: Bearer $MEILI_SEARCH_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{"q":"mug"}'

The document "Ceramic mug" should appear in the hits array. Repeat the test with the kubke query to check typo tolerance with the default settings. When you are done, remove the variables from your terminal:

unset MEILI_ADMIN_KEY MEILI_SEARCH_KEY

Connecting your own website

After a successful test, select the data that should go into the appropriate index. Determine when the integration adds new records, updates changed ones, and removes withdrawn ones. Test the entire cycle with one product before running a full import. Also plan how to rebuild the index from the data source.

The search form should use a separate key with limited permissions. For content that requires logging in, design access control on the application side. Simply hiding a field in the interface does not restrict access through the API.

Frequently asked questions

How much does Meilisearch cost on Saplo?

The cheapest plan that meets the installation requirements is Box S for $29 per year. With a larger dataset, check resource usage during import and search.

Why can't I see the search engine under my domain?

The Saplo installation runs in production mode as an API. Start with /health, then perform the import and query from the guide. You add the user-facing form to your own site.

What should I check when an authorization error occurs?

Compare the API URL and key with the correct installation. The header format is Authorization: Bearer .... A key with only the search permission cannot be used to import documents or manage keys.

Why are there no results after the import?

First, check the task status. Then compare the index name in the query URL with the name used during the import. Also check whether the document contains the content you're looking for.

Will Meilisearch pull products from the store on its own?

No. The installation runs the search engine. The integration with your store or app provides data synchronization and the results form.

Open the Meilisearch offer on Saplo, start the service and begin with two sample documents. Once import and search work, connect your own catalog.

  • #Meilisearch
  • #Self-hosting
  • #Guide
  • #Search engine