Search Plugin
هذا المحتوى غير متوفر بلغتك بعد.
Search Plugin
Section titled “Search Plugin”The search plugin provides a unified search API across three backends. App code written against any one backend works with the others by changing one env var and restarting.
Backend Comparison
Section titled “Backend Comparison”| Feature | MeiliSearch | Typesense | OpenSearch |
|---|---|---|---|
| Best for | Small deploys, low RAM | Multi-tenant, teams | Enterprise, compliance |
| Multi-tenant isolation | Filter-based | Scoped API keys | Role + filter |
| Schema | Auto-inferred | Schema-first (auto on first batch) | Dynamic mappings |
| Disk footprint | Low | Medium | High |
| TLS in dev | Optional | Optional | OPENSEARCH_TLS_VERIFY=false |
| Bundle | search ($0.99/mo) | search ($0.99/mo) | search ($0.99/mo) |
All three share the same HTTP API surface on port 8050 (CS_3).
Installation
Section titled “Installation”nself license set nself_pro_xxxx...nself plugin install searchnself buildConfiguration
Section titled “Configuration”Set SEARCH_ENGINE to choose the active backend. All other vars for the
inactive backends are ignored.
MeiliSearch (default)
Section titled “MeiliSearch (default)”SEARCH_ENGINE=meilisearchMEILISEARCH_URL=http://localhost:7700MEILISEARCH_MASTER_KEY=your-master-keyTypesense
Section titled “Typesense”SEARCH_ENGINE=typesenseTYPESENSE_HOST=localhostTYPESENSE_PORT=8108TYPESENSE_PROTOCOL=httpsTYPESENSE_API_KEY=your-api-keyOpenSearch
Section titled “OpenSearch”SEARCH_ENGINE=opensearchOPENSEARCH_URL=https://localhost:9200OPENSEARCH_USERNAME=adminOPENSEARCH_PASSWORD=your-password# Dev only, allows self-signed certificate:OPENSEARCH_TLS_VERIFY=falseAPI Reference
Section titled “API Reference”All routes are prefixed /search and served by the plugin on port 8050.
| Method | Path | Description |
|---|---|---|
GET | /search/status | Backend type, version, stats |
GET | /search/indexes | List all indexes |
POST | /search/index/:name/documents | Upsert documents |
DELETE | /search/index/:name/documents/:id | Delete a document |
POST | /search/index/:name/query | Full-text search |
POST | /search/index/:name/schema | Create or update index schema |
Upsert documents
Section titled “Upsert documents”POST /search/index/products/documents[{"id": "1", "title": "Widget", "price": 9.99}]Search
Section titled “Search”POST /search/index/products/query{"query": "widget", "limit": 20, "highlight_fields": ["title"]}Status response
Section titled “Status response”{ "backend": "typesense", "version": "0.25.2", "indexes": 4, "extra": {"ok": true}}Multi-tenant Isolation (Typesense)
Section titled “Multi-tenant Isolation (Typesense)”When using SEARCH_ENGINE=typesense, the plugin reads the X-Hasura-Role
request header and generates a Typesense scoped API key that restricts results
to documents tagged with that role. Queries from different roles cannot see
each other’s documents within the same collection.
Switching Backends
Section titled “Switching Backends”Changing SEARCH_ENGINE and restarting the plugin triggers a full reindex
from Postgres (np_search_documents table). The reindex runs automatically
on startup, no manual intervention required.
Hasura Remote Schema
Section titled “Hasura Remote Schema”The search plugin is wired into Hasura under the search namespace. Queries
use the same search namespace regardless of the active backend.
Database Migration
Section titled “Database Migration”On startup the plugin applies:
ALTER TABLE np_search_indexes ADD COLUMN IF NOT EXISTS backend TEXT NOT NULL DEFAULT 'meilisearch';This is idempotent and safe to run repeatedly.