Migratus entry points for search_documents.filters.
Migratus entry points for search_documents.filters.
HTTP API routes and admin web UI handlers for wagoe-search.
API Endpoints (mounted under /api/v1): POST /search/:index-id — search POST /search/:index-id/suggest — trigram suggestions POST /search/documents — index a document DELETE /search/documents/:type/:id — remove a document
Admin Web UI (mounted under /web/admin): GET /search — list all indices GET /search/:index-id — index detail + live search form POST /search/:index-id/search — HTMX search results fragment
Searching takes a signed-in user; indexing, removing and the admin pages take the admin role (BOU-568).
Search, suggest and the admin pages serve only an index whose definition
opts in with :api? true or an :api :authorize fn; a hook, when set, must
accept the request. Any other index answers 404, as an unknown one does, so
a caller cannot tell the two apart.
An index whose definition lists :tenant-id among its :filters is
tenant-scoped. A search of one reads the request's resolved tenant, and only
for a caller in it (access/in-tenant-scope?); a tenant_id the caller
sends is dropped. With no tenant resolved, only a global admin may search it, with
whatever filters they send. Anyone else gets 403.
HTTP API routes and admin web UI handlers for wagoe-search. API Endpoints (mounted under /api/v1): POST /search/:index-id — search POST /search/:index-id/suggest — trigram suggestions POST /search/documents — index a document DELETE /search/documents/:type/:id — remove a document Admin Web UI (mounted under /web/admin): GET /search — list all indices GET /search/:index-id — index detail + live search form POST /search/:index-id/search — HTMX search results fragment Searching takes a signed-in user; indexing, removing and the admin pages take the admin role (BOU-568). Search, suggest and the admin pages serve only an index whose definition opts in with `:api? true` or an `:api :authorize` fn; a hook, when set, must accept the request. Any other index answers 404, as an unknown one does, so a caller cannot tell the two apart. An index whose definition lists `:tenant-id` among its `:filters` is tenant-scoped. A search of one reads the request's resolved tenant, and only for a caller in it (`access/in-tenant-scope?`); a `tenant_id` the caller sends is dropped. With no tenant resolved, only a global admin may search it, with whatever filters they send. Anyone else gets 403.
Integrant lifecycle management for the search module.
Config keys:
:wagoe/search {:db-ctx (ig/ref :wagoe/db-context) :indexes {index-id definition} ; from config.edn :contributed {index-id definition}} ; modules' :search parts
Returns {:store <ISearchStore> :engine <ISearchEngine>}
:wagoe/search-routes {:search-service (ig/ref :wagoe/search)}
Returns {:api [...] :web [...] :static []} for composition by the HTTP handler.
Integrant lifecycle management for the search module.
Config keys:
:wagoe/search
{:db-ctx (ig/ref :wagoe/db-context)
:indexes {index-id definition} ; from config.edn
:contributed {index-id definition}} ; modules' :search parts
Returns {:store <ISearchStore> :engine <ISearchEngine>}
:wagoe/search-routes
{:search-service (ig/ref :wagoe/search)}
Returns {:api [...] :web [...] :static []} for composition
by the HTTP handler.Database persistence for search documents.
Implements ISearchStore using next.jdbc + HoneySQL for DML and raw parameterized SQL for FTS-specific queries.
Strategies chosen by the adapter's capabilities (ADR-039):
Database persistence for search documents. Implements ISearchStore using next.jdbc + HoneySQL for DML and raw parameterized SQL for FTS-specific queries. Strategies chosen by the adapter's capabilities (ADR-039): - :full-text — to_tsvector/plainto_tsquery + ts_rank + ts_headline, and pg_trgm suggestions where it is installed; without it, a LOWER/LIKE fallback - :on-conflict — INSERT … ON CONFLICT DO UPDATE; without it, delete and insert in one transaction
Deprecated: a process-global registry of search index definitions.
Hand definitions to :wagoe/search instead — under :indexes in config or
a module's :search part — and bind them with
wagoe.search.core.index/defsearch. The search service still reads this
registry for an id its component does not hold, and logs once per such id.
Key functions:
Deprecated: a process-global registry of search index definitions. Hand definitions to `:wagoe/search` instead — under `:indexes` in config or a module's `:search` part — and bind them with `wagoe.search.core.index/defsearch`. The search service still reads this registry for an id its component does not hold, and logs once per such id. Key functions: - defsearch macro — define and register an index - register-search! — low-level registration - get-search — look up by index-id - list-searches — list registered index ids - clear-registry! — reset registry (test fixtures)
SearchService orchestrates document indexing and search queries.
Implements ISearchEngine by coordinating:
SearchService orchestrates document indexing and search queries.
Implements ISearchEngine by coordinating:
- core/index — document construction
- core/query — query sanitization
- definitions — the index definitions this service was built with, then
the deprecated global registry
- ISearchStore — persistence operationspg_trgm, which suggestions on PostgreSQL use. Creating it can take a privilege the migration user lacks; suggestions then use LIKE (BOU-661).
pg_trgm, which suggestions on PostgreSQL use. Creating it can take a privilege the migration user lacks; suggestions then use LIKE (BOU-661).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |