Load-time registry of search index definitions.
The registry is mutable process state, so it lives in the shell — the core
(boundary.search.core.index) stays pure (document construction and filter-key
conversion only). Definitions are registered at namespace load via the
defsearch macro and read at runtime by the search service.
Key functions:
Load-time registry of search index definitions. The registry is mutable process state, so it lives in the shell — the core (boundary.search.core.index) stays pure (document construction and filter-key conversion only). Definitions are registered at namespace load via the `defsearch` macro and read at runtime by the search service. 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)
(clear-registry!)Remove all registered definitions. Use in test fixtures.
Returns: nil
Remove all registered definitions. Use in test fixtures. Returns: nil
(defsearch var-name definition)Define a search index configuration and register it globally.
Binds a var and registers in the in-process search registry.
Example: (defsearch product-search {:id :product-search :entity-type :product :language :english :fields [{:name :title :weight :a} {:name :description :weight :b} {:name :tags :weight :c}] :options {:highlight? true :trigrams? true}})
This is equivalent to: (def product-search {...}) (register-search! product-search)
Define a search index configuration and register it globally.
Binds a var and registers in the in-process search registry.
Example:
(defsearch product-search
{:id :product-search
:entity-type :product
:language :english
:fields [{:name :title :weight :a}
{:name :description :weight :b}
{:name :tags :weight :c}]
:options {:highlight? true
:trigrams? true}})
This is equivalent to:
(def product-search {...})
(register-search! product-search)(get-search index-id)Retrieve a registered SearchDefinition by id.
Args: index-id - keyword
Returns: SearchDefinition map or nil
Retrieve a registered SearchDefinition by id. Args: index-id - keyword Returns: SearchDefinition map or nil
(list-searches)List all registered search index ids.
Returns: Vector of keyword ids
List all registered search index ids. Returns: Vector of keyword ids
(register-search! definition)Register a SearchDefinition in the global registry.
Args: definition - SearchDefinition map with :id keyword
Returns: :id keyword
Register a SearchDefinition in the global registry. Args: definition - SearchDefinition map with :id keyword Returns: :id keyword
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 |