Docs
GuidesConfiguration

Typesense search (optional)

Speed up and improve every search in HWD POS with the optional Typesense search engine.

HWD POS can speed up all its searches with Typesense, a typo-tolerant search engine: products, customers, suppliers and the documents of the sales chain (quotation → order → invoice → delivery → shipment → credit).

It is completely optional. There is an automatic fallback to SQL: if Typesense is off, not configured or not responding, every search uses the same SQL query as always. You never lose search.

The switch

The switch (on by default), the connection details, Test connection and Reindex all are in System → Health and backups → Search service (Sistema → Salud y respaldos → Servicio de búsqueda, /admin/system).

With an empty API key the switch does not matter: SQL search is used. This is the default behavior.

1. Install and start the Typesense server

Recommended. On the server, open hwdpanel and choose 14) Install/update search service (Typesense + auto-start).

It downloads the official binary, sets it up as the typesense-server systemd service (starts automatically after a reboot), generates the admin API key if none exists, registers the connection in HWD POS and rebuilds the index. Nothing else needs to be done.

Use a long, random value for YOUR_TYPESENSE_KEY.

API keys

Option 14 generates or reuses the admin key (the --api-key one), which HWD POS uses to index and search.

For additional keys, for example a search-only key for an external client, use 15) Manage search keys in hwdpanel. It lists, creates (showing the value only once) and deletes keys through the Typesense API.

2. Configure the connection in HWD POS

Either method is enough. On Ubuntu, hwdpanel option 14 already does it for you.

From the interface. In System → Search service (Sistema → Servicio de búsqueda), fill in:

FieldValue
Host127.0.0.1
Port8108
Protocolhttp
API keyYour Typesense key

Click Save, then Test connection.

From storage/config.php. Add a typesense block under app (see Application configuration):

return [
  'db'  => [ /* … */ ],
  'app' => [
    // …
    'typesense' => [
      'host'     => '127.0.0.1',
      'port'     => '8108',
      'protocol' => 'http',
      'api_key'  => 'YOUR_TYPESENSE_KEY',
    ],
  ],
];

With an empty API key, Typesense stays off and everything works with SQL.

3. Build the index (required the first time)

cd /var/www/HWDPOS && php scripts/typesense_reindex.php

This creates the collections (products, customers, suppliers, documents) and uploads all records. You can also use the Reindex all button on the search service screen.

4. Keep the index up to date

  • Incremental (automatic). When you save a product, customer or supplier, or issue quotations, invoices, orders or credits, HWD POS updates Typesense in the background. It is best-effort: it never blocks or breaks the operation.
  • Cron (recommended). A periodic reindex covers any change made from outside the application: bulk imports, direct database edits, or renaming customers who appear in documents.
*/10 * * * * cd /var/www/HWDPOS && php scripts/typesense_reindex.php >/dev/null 2>&1

If Typesense is down

HWD POS uses short connection timeouts, so if the Typesense server is down the fallback to SQL is immediate. Searches keep working with the standard SQL search; restart the service (sudo systemctl restart typesense-server) and reindex if needed.

On this page