A pluggable search index. Keyed by index (a resource’s base_path()), so
one backend serves every searchable resource. Async — it does I/O, once per
mutation, not per request.
Project a stored row to the document to index: just the resource’s declared
search_fields (plus nothing else — the id is carried separately). Missing
fields are simply absent.
Index (or re-index) a record after a write. Best-effort: an indexing failure
is logged, never propagated — a search backend hiccup must not fail the write
the user asked for. The index catches up on the next write or a reindex.
Whether search is on. Default CRUD checks this before spending a read to
build a document, so an unindexed app issues exactly the queries it did
before this module existed.
The q full-text term from a request query string, trimmed; None when
absent or blank. The list page uses this to decide between a search and the
normal paginated listing.
Search an index, returning matching ids in rank order. Returns empty (never
errors to the caller) so a list page renders even when the backend is down.