🌐 Language: 🇻🇳 Tiếng Việt · 🇬🇧 English (current) · 🇯🇵 日本語
Product search in S-Cart
Introduction
S-Cart finds products through a dedicated search index instead of reading every product description again each time a shopper types. A store with tens of thousands of products still answers fast on a small server, keywords typed without accents still find accented names, Japanese typed without spaces is still found, and products matching by name come before products matching only in the description. This guide is for store owners: how matching works, what to do after updating, how to rebuild the index and when to use an external search engine.
At a glance
flowchart LR
A["Shopper types a keyword"] --> B["Search index<br/>(or an external engine)"]
B --> C["S-Cart checks again<br/>store, status, stock"]
C --> D["Results:<br/>name matches first"]
- Fast on a large store — the index is built in advance, so a search does not read every description again.
- Found however it is typed — without accents, in any letter case, Japanese / Chinese / Korean without spaces, half-width katakana or hiragana.
- Matches the beginning of a word —
kettfinds "kettle", but a piece from the middle of a word does not. - Keeps itself up to date, no cron needed — saving or deleting a product updates that product in the index.
- A site updated from an older version builds the index once — in Configuration → Search; meanwhile search keeps working the old way.
ℹ️ Available since: gp247/shop 3.17.0
On this page
- 1. Where the index is used
- 2. How matching works — word matching, order of results
- 3. After updating from an older version: build the index once
- 4. The index keeps itself up to date
- 5. Using an external search engine — the Meilisearch plugin
- 6. For developers
- Conditions & Rules
1. Where the index is used
One index serves every place where products are searched:
| Where | Language searched |
|---|---|
| The store's search box (search page, product grid) | the language the shopper is viewing |
| The product list in the admin | the admin's language |
| REST API (product list) | the requested language, every language when none is given |
| AI assistants connected through MCP | every language |
2. How matching works
- Each word you type matches the beginning of a word in: the name, SKU, URL alias, keywords, brand name, category names and roughly
the first 64 words of the short description.
kettfinds "Electric kettle". - Several words ⇒ a product must match every word.
steel kettleonly finds products with both "steel" and "kettle". - Letter case and accents do not matter:
am dun nuocfinds "Ấm đun nước";đtyped asdworks too. - Japanese, Chinese and Korean need no spaces:
電気ケトルfinds "ステンレス電気ケトル"; typing one character (茶) finds every product containing it (緑茶,紅茶). - Half-width katakana and hiragana:
ケトル(common in data imported from point-of-sale systems and old spreadsheets) andけとるboth find "ケトル", and the other way round. Searching by the reading of a kanji does not work:でんきdoes not find "電気". - SKUs match from their start:
ZZ-KETorzzketboth findZZ-KET-001. - Order: when the shopper has not picked a sort, products matching in the name come first, then SKU, keywords, brand, category, description. Products that match equally follow the sort order you set in the admin, then newer products first. When the shopper picks a sort (price, newest…), that order is used.
- Very common keywords: with no sort and no filter chosen, a single-store shop lists the 1,000 most relevant products — enough for a shopper's search and keeps the search page fast. Adding a filter (category, brand, price…) or picking a sort shows every matching product.
- Searching the admin product list of a very large store: when every word you type appears in tens of thousands of products, the list shows at once, and the total number of results and the last page number appear a few seconds later (the pagination bar says "counting…"; previous / next still work). Typing another word or choosing a category shows the total at once as usual.

⚠️ Different from before: S-Cart no longer matches a piece from the middle of a word.
ettleno longer finds "kettle". The long content of a product (the part written in the editor) is not searched either — put the words shoppers type into the product's name or keywords.
3. After updating from an older version: build the index once
A fresh installation has its index ready at once. A site updated from an older version builds the index once:
- Update as usual (
composer update, thenphp artisan gp247:update). - Go to Configuration → Search tab and click Rebuild index.
- Keep the page open until the state turns Ready. Closing the page midway is fine: open it again and click again — the build continues from where it stopped.

While the index is not ready, search keeps working the old way (slower on a large store) — the store is never interrupted. Later on, clicking Rebuild index while the index is ready keeps search fast during the whole rebuild. The System alerts block on the admin home page reminds you until the index is ready.
flowchart LR
A["Update S-Cart"] --> B["Index: not built<br/>(old search)"]
B -->|"Configuration → Search<br/>Rebuild index"| C["Building x%"]
C -->|"close the page, open again"| C
C --> D["Ready<br/>(fast search)"]
Very large stores
The browser builds in small parts (500 products at a time). If you can run commands on the server, a store with hundreds of thousands of products is better built with the command:
php artisan gp247:shop-search-index
See the state without building: php artisan gp247:shop-search-index --status. Running the command again gives the same result, and it
continues if interrupted.
4. The index keeps itself up to date
You need no cron or queue: saving, duplicating or deleting a product updates that product in the index right after the page has saved. Renaming a brand or a category updates the related products gradually over the next searches. The Search tab shows how many products are indexed, how many wait to be indexed again and when the last build ran.
A plugin or import tool that writes straight into the database (not through the admin) can leave the index out of date. When search results do not match your data, click Rebuild index.
5. Using an external search engine
The S-Cart index is enough for most stores. A very large store, or one that wants shoppers to find products even with spelling mistakes, can use Meilisearch — a dedicated search engine — through the free Meilisearch plugin (it needs a Meilisearch server; the plugin README explains the setup).
- Install and enable the plugin, and enter the address and key of the Meilisearch server.
- Go to Configuration → Search and choose Meilisearch in the Search engine field.
- Click Rebuild index to send every product over. The store starts searching through Meilisearch only once this rebuild is done.
S-Cart still checks each result (store, status, stock) before showing it. If Meilisearch fails or answers slowly, the store falls back to the S-Cart index on its own — shoppers still find products.
6. For developers
To connect another search engine (Typesense, OpenSearch, Algolia…), write a driver plugin following Writing a product search driver.
💡 Working with an AI agent? Use the
gp247-plugin-createskill from the gp247-skills repo to scaffold the plugin, then write the driver following the page above.
Conditions & Rules (know before you act)
Who can do what
- See the Search tab: anyone allowed to configure the store.
- Rebuild the index and choose the search engine: only an administrator of the root store — the index is shared by the whole site, and one sub-store should not make the whole site rebuild.
When searching
- Only the beginning of a word matches — that is what makes the index fast; to let shoppers search by another name, add it to the product's keywords.
- Long content (the part written in the editor) is not searched, and only about the first 64 words of the short description — to keep the index compact and results relevant.
- At most the 1,000 most relevant results with no filter and no sort chosen, on a single-store shop — to keep the search page fast for common keywords.
When rebuilding and when changing the engine
- The search engine cannot be changed during a rebuild — so half of the products do not go to the old engine and half to the new one.
- A newly chosen external engine does not answer searches until one rebuild is done — it holds no products at first; answering early would return empty results for every search.
Q&A
Q1: What if a shopper types a piece from the middle of a product name?
→ It is not found. Add the names shoppers use (abbreviations, other names) to the product's keywords.
Q2: How much database space does the index take?
→ The Search tab shows an estimated size. It is usually about the size of the product description table (measured on 50,000 products in three languages: about 1.5 times); the longer the short descriptions, the larger the index.
Q3: Does it work on shared hosting without cron?
→ Yes. Everything runs within the page (saving products, the rebuild button) — no cron, queue or server command needed. Meilisearch alone needs a server able to run it (a VPS or the Meilisearch Cloud service).
Q4: Who sees the Search tab?
→ Anyone allowed to configure the store. Only an administrator of the root store can rebuild the index and choose the search engine.
Q5: Two products match equally — which one comes first?
→ The one with the smaller sort order (set in the admin); with the same sort order, the newer product comes first.
Q6: If the Meilisearch server is down, does the store lose search?
→ No. S-Cart uses its own index again; the Search tab asks you to rebuild once Meilisearch is back so it receives every change.
📅 Last updated: 2026-12-02 · ✍️ Author: GP247