> ## Documentation Index
> Fetch the complete documentation index at: https://nikita-shkoda.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deferred Typesense Features

> Catalog Typesense capabilities relevant to deferred features. Capability tables, proposed DSL shapes, compiler mappings, and recommendations.

### Related links

* <a href="/projects/search-engine-for-typesense/v30/multi-search">Multi-search</a>
* <a href="/projects/search-engine-for-typesense/v30/presets">Presets</a>
* <a href="/projects/search-engine-for-typesense/v30/ranking">Ranking</a>
* <a href="/projects/search-engine-for-typesense/v30/faceting">Faceting</a>
* <a href="/projects/search-engine-for-typesense/v30/highlighting">Highlighting</a>
* <a href="/projects/search-engine-for-typesense/v30/observability">Observability</a>
* <a href="/projects/search-engine-for-typesense/v30/dx">DX</a>
* <a href="/projects/search-engine-for-typesense/v30/hit-limits">Hit Limits</a>

### Method & sources

* Primary: Official Typesense docs (API reference + feature guides), favoring versioned pages. Inline citations use bracketed labels (e.g., \[TS‑SearchParams]). See Sources for URLs.
* Cross‑checks: When behavior seemed ambiguous, we verified across Search Parameters, Faceting, and Feature pages.
* Versioning: When docs do not specify version gates, we mark as TBD.

***

## Capability tables

Each table lists exact server parameter names, constraints, interactions, proposed DSL shape (additive/back‑compat), compiler mapping, and ship bucket.

### 1) Union (logical OR across collections/queries)

| Capability                       | Typesense params (authoritative names)                                                                                               | Since | Constraints & limits                                                                                                      | Interactions                                      | Defaults (server) | Proposed DSL surface (back‑compat) | Compiler mapping (Relation → params) | Migration notes                                                                            | Risk                                                                                         | Ship bucket |       |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ----- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | ----------------- | ---------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- | ----------- | ----- |
| Union across collections/queries | `multi_search` endpoint with `searches: [...]` payload; each search has its own `collection`, `q`, `query_by`, etc \[TS‑MultiSearch] | TBD   | Results are independent per search; no native cross‑collection dedupe/merge. Response size/latency grows with N searches. | Pagination, sorting, and faceting are per‑search. | N/A               | \`union(queries:, merge: :append   | :interleave, dedupe\_by: nil)\`      | Compile to a Multi‑search request; perform merge/dedupe client‑side (respect sort orders). | Back‑compatible; purely additive. Clarify that ranking is not recomputed across collections. | M           | Later |

Notes: In Typesense, “union” is not a first‑class server feature; client must aggregate multi‑search responses. \[TS‑MultiSearch]

### 2) Synonyms / Stopwords (management + query‑time switches)

| Capability                      | Typesense params (authoritative names)                                       | Since | Constraints & limits                                                 | Interactions                                                       | Defaults (server)                                     | Proposed DSL surface (back‑compat)               | Compiler mapping (Relation → params)                         | Migration notes                                                    | Risk | Ship bucket |
| ------------------------------- | ---------------------------------------------------------------------------- | ----- | -------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------------ | ---- | ----------- |
| Synonym sets (per collection)   | Synonyms API: CRUD at `/collections/{collection}/synonyms` \[TS‑Synonyms]    | TBD   | Stored per collection; large sets affect index size and build times. | Affects token expansion and recall; interacts with typo tolerance. | Applied if present; no per‑query override documented. | `manage_synonyms(add:[], upsert:[], delete:[])`  | Use client to call Synonyms API (out of band from Relation). | Management is orthogonal to query DSL; document CLI/doctor checks. | M    | Later       |
| Stopword lists (per collection) | Stopwords API: CRUD at `/collections/{collection}/stopwords` \[TS‑Stopwords] | TBD   | Excessive stopwords can reduce recall.                               | Interacts with token dropping thresholds.                          | Applied if present; no per‑query override documented. | `manage_stopwords(add:[], upsert:[], delete:[])` | Use client to call Stopwords API (out of band).              | Same as synonyms; ensure indexer/docs cover precedence.            | M    | Later       |

Notes: Per‑query enable/disable flags for synonyms/stopwords are not documented; treat as index‑time configuration. \[TS‑Synonyms] \[TS‑Stopwords]

### 3) Highlighting controls

| Capability   | Typesense params (authoritative names)                                                                                                   | Since | Constraints & limits                           | Interactions                                      | Defaults (server)                                                                 | Proposed DSL surface (back‑compat)                                                               | Compiler mapping (Relation → params)                                                                                     | Migration notes                                   | Risk | Ship bucket |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | ----- | ---------------------------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | ---- | ----------- |
| Highlighting | `highlight_fields`, `highlight_full_fields`, `highlight_affix_num_tokens`, `highlight_start_tag`, `highlight_end_tag` \[TS‑SearchParams] | TBD   | Increasing affix tokens inflates payload size. | Interacts with `include_fields`/`exclude_fields`. | Start/end tags default to `<mark>`/`</mark>`; affix tokens default commonly to 4. | `highlight(fields:, full_fields: nil, affix_tokens: 4, start_tag: "<mark>", end_tag: "</mark>")` | Map 1:1 to `highlight_*` params; validate field presence against schema; redact highlighted text in logs via DX helpers. | Additive; default off maintains current behavior. | L    | Now         |

Validation: disallow both `include_fields` and `exclude_fields` hiding all highlighted fields; hint with \[Error UX] to enable specific fields. \[TS‑SearchParams]

### 4) Advanced faceting

| Capability                                          | Typesense params (authoritative names)                       | Since | Constraints & limits                                          | Interactions                                                                   | Defaults (server)                       | Proposed DSL surface (back‑compat)                                            | Compiler mapping (Relation → params)                                                | Migration notes                                     | Risk | Ship bucket |
| --------------------------------------------------- | ------------------------------------------------------------ | ----- | ------------------------------------------------------------- | ------------------------------------------------------------------------------ | --------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------------- | ---- | ----------- |
| Facets (basic + query)                              | `facet_by`, `max_facet_values`, `facet_query` \[TS‑Faceting] | TBD   | Large facet cardinalities increase response size and compute. | Interacts with filters and grouping; per‑page/page do not affect facet counts. | `max_facet_values` default commonly 10. | `facet(by:, max_values: nil, query: nil)`                                     | Map 1:1; split multi‑field lists by comma; validate fields are facetable in schema. | Additive; aligns with existing Typesense semantics. | M    | Now         |
| Nested/combined facets; sampling; custom facet sort | Not documented as first‑class features \[TS‑Faceting]        | —     | Treat as unsupported server‑side for now.                     | —                                                                              | —                                       | `facet_nested(...)`, `facet_sample(...)`, `facet_sort(...)` (shapes reserved) | N/A (intentionally not compiled)                                                    | Document as deferred; capture use‑cases.            | M    | Later       |

### 5) Geo -- Shipped

| Capability                  | Typesense params (authoritative names)                                                                         | Since | Constraints & limits                                                | Interactions                                                 | Defaults (server) | Proposed DSL surface (back‑compat)                                                                  | Compiler mapping (Relation → params)                                                                                    | Migration notes                  | Risk     | Ship bucket |
| --------------------------- | -------------------------------------------------------------------------------------------------------------- | ----- | ------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------- | --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -------- | ----------- |
| Geo filters & distance sort | `filter_by` with geopoint expressions; `sort_by` with distance for a geopoint field \[TS‑Geo] \[TS‑FieldTypes] | 30.1  | Requires `geopoint` field in schema; precision depends on indexing. | Interacts with other filters and sorts; grouping unaffected. | N/A               | `where_geo(field, within_radius: / within_polygon:)`, `order_geo(field, from:)`, `order_eval(expr)` | Compile to `filter_by` geo predicate and `sort_by` distance/eval tokens; validate schema geopoint type and coordinates. | Additive; no effect unless used. | Resolved | Shipped     |

<Info>
  Geo search is now fully implemented. See the <a href="/projects/search-engine-for-typesense/v30/geo-search">Geo Search guide</a> for DSL reference, configuration, and examples.
</Info>

### 6) Vectors / AI (vector fields, ANN params, hybrid) -- Shipped

| Capability    | Typesense params (authoritative names)                                                                                                  | Since | Constraints & limits                                               | Interactions                                                                                        | Defaults (server)                            | Proposed DSL surface (back‑compat)                                                              | Compiler mapping (Relation → params)                                                                                           | Migration notes                  | Risk     | Ship bucket |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | -------- | ----------- |
| Vector search | `vector_query` with syntax `field:([vector], k:N, alpha:0.8, ...)`; schema `float[]` field with `embed` block or `num_dim` \[TS‑Vector] | 30.1  | Vector dimensionality must match schema; high `k` affects latency. | Hybrid with keyword search uses rank fusion (`alpha`); embedding field auto-appended to `query_by`. | Embedding field auto-excluded from response. | `embedding` macro (schema), `vector_search(field, k:, alpha:, ...)`, `find_similar(id, field:)` | Compile to `vector_query` string; auto `query_by` in hybrid mode; auto `exclude_fields`; `order(vector_distance:)` sort alias. | Additive; no effect unless used. | Resolved | Shipped     |

<Info>
  Vector search is now fully implemented. See the <a href="/projects/search-engine-for-typesense/v30/vector-search">Vector Search guide</a> for DSL reference, configuration, and examples.
</Info>

### 7) Hit limits (caps, per‑group limits, pagination interactions)

| Capability        | Typesense params (authoritative names)                                                                                                    | Since | Constraints & limits                                                                            | Interactions                                                     | Defaults (server)                         | Proposed DSL surface (back‑compat)                                                     | Compiler mapping (Relation → params)                                                 | Migration notes                                  | Risk | Ship bucket |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------ | ---- | ----------- |
| Pagination & caps | `per_page`, `page`, `group_by`, `group_limit`, `exhaustive_search`, `search_cutoff_ms` \[TS‑Pagination] \[TS‑Grouping] \[TS‑SearchParams] | TBD   | Large `per_page` inflates payloads; `exhaustive_search:false` can truncate recall under cutoff. | Grouping limits apply within groups; affects perceived per‑page. | `page=1`, `per_page=10` typical defaults. | `limit(per_page:, page: 1)`, `group(by:, limit:)`, `exhaustive(on:)`, `cutoff_ms(ms:)` | Map 1:1; validate positive integers; hint when `group_limit * groups` \< `per_page`. | Additive; preserves current defaults when unset. | L    | Now         |

***

## Recommendations

* <strong>Now</strong> (ship in this bucket)
  * Highlighting controls: 1:1 param mapping; low risk; straightforward compile‑time validation. Add DX redaction for highlighted snippets in logs. Minimal DSL: <code>highlight(fields:, full\_fields:, affix\_tokens:, start\_tag:, end\_tag:)</code>.
  * Basic faceting controls: <code>facet\_by</code>, <code>max\_facet\_values</code>, <code>facet\_query</code>. Minimal DSL: <code>facet(by:, max\_values:, query:)</code>. Tests: compile mapping + param validation.
  * Hit limits & pagination: <code>per\_page</code>, <code>page</code>, <code>group\_by</code>, <code>group\_limit</code>, <code>exhaustive\_search</code>, <code>search\_cutoff\_ms</code>. Minimal DSL: <code>limit</code>, <code>group</code>, <code>exhaustive</code>, <code>cutoff\_ms</code>. Tests: pagination math + grouping interactions.

* <strong>Later</strong> (defer)
  * Union across collections: requires client‑side merge/dedupe policy and observability; define deterministic interleaving before shipping. Prereq: merge policy & perf guardrails. Unknowns: cross‑search ranking.
  * Synonyms/Stopwords management: scope belongs to admin/CLI; wire separately from Relation DSL. Add doctor checks and docs; no query‑time flag exposed in docs today.
  * ~~Geo~~: **Shipped.** See <a href="/projects/search-engine-for-typesense/v30/geo-search">Geo Search</a>.
  * ~~Vectors/Hybrid~~: **Shipped.** See <a href="/projects/search-engine-for-typesense/v30/vector-search">Vector Search</a>.
  * Advanced faceting extras (nested/sampling/custom sort): out of scope until server primitives exist.

* <strong>Flags & defaults</strong>
  * Config kill‑switches: <code>config.features.highlighting</code>, <code>config.features.faceting</code>, <code>config.features.grouping</code>, <code>config.features.exhaustive\_search</code> (default off for new features).
  * Presets: ship safe defaults aligned with server (e.g., <code>affix\_tokens=4</code>, <code>max\_facet\_values=10</code>, <code>page=1</code>, <code>per\_page=10</code>).
  * Observability: when active, log feature flags and normalized params into our instrumentation events (see <a href="/projects/search-engine-for-typesense/v30/observability">Observability</a>).

***

## Open questions & risk register

Per capability:

* <strong>Union</strong>
  * Open: How do we interleave/dedupe results deterministically across searches? What’s the pagination model? \[TS‑MultiSearch]
  * Risk: M — correctness/perf of client‑side merge. Mitigation: stable policy + benchmarks + feature flag.

* <strong>Synonyms/Stopwords</strong>
  * Open: Any per‑query enable/disable flags? If not, should we simulate via presets? \[TS‑Synonyms] \[TS‑Stopwords]
  * Risk: M — admin surface creep in query DSL. Mitigation: keep in CLI/admin; add doctor checks.

* <strong>Highlighting</strong>
  * Open: Confirm defaults per server version for <code>highlight\_affix\_num\_tokens</code>. \[TS‑SearchParams]
  * Risk: L — payload size/perf. Mitigation: conservative defaults and size logging.

* <strong>Advanced faceting</strong>
  * Open: Are nested/sampled facets planned server‑side? \[TS‑Faceting]
  * Risk: M — API churn if we guess semantics. Mitigation: reserve DSL names; do not compile until server supports.

* <strong>Geo</strong> — **Resolved.** Shipped with full DSL: <code>where\_geo</code>, <code>order\_geo</code>, <code>order\_eval</code>, <code>geo\_distance\_meters</code>, <code>:geopoint</code> schema type. See <a href="/projects/search-engine-for-typesense/v30/geo-search">Geo Search</a>.

* <strong>Vectors/Hybrid</strong> — **Resolved.** Shipped with full DSL: <code>embedding</code> macro, <code>vector\_search</code>, <code>find\_similar</code>, hybrid alpha weighting, auto‑exclude, redaction. See <a href="/projects/search-engine-for-typesense/v30/vector-search">Vector Search</a>.

* <strong>Hit limits</strong>
  * Open: Interactions between <code>group\_limit</code>, <code>group\_by</code>, and <code>per\_page</code> across edge cases; clarify <code>exhaustive\_search</code> semantics with <code>search\_cutoff\_ms</code>. \[TS‑Pagination]
  * Risk: L — UX confusion. Mitigation: compile‑time hints and cookbook examples.

***

## Migration & documentation plan

* YARD earmarks: add short docstrings for new public DSL entry points (<code>highlight</code>, <code>facet</code>, <code>limit</code>, <code>group</code>, <code>exhaustive</code>, <code>cutoff\_ms</code>) describing param mapping and defaults.
* Docs: link this memo from project index; add anchors in Relation Guide and examples in Cookbook Queries for highlighting/faceting/pagination.
* CLI/doctor: add checks that surface misconfigurations (e.g., requesting highlight on non‑indexed fields; <code>group\_limit</code> > <code>per\_page</code>).
* Observability: extend event payload to include normalized feature flags and redacted values.

### Sources

* \[TS‑SearchParams] Typesense — Search Parameters (versioned): <code>[https://typesense.org/docs/29.0/api/search.html](https://typesense.org/docs/29.0/api/search.html)</code>
* \[TS‑Faceting] Typesense — Faceting (on Search Parameters page): <code>[https://typesense.org/docs/29.0/api/search.html#faceting](https://typesense.org/docs/29.0/api/search.html#faceting)</code>
* \[TS‑Highlight] Typesense — Highlighting (on Search Parameters page): <code>[https://typesense.org/docs/29.0/api/search.html#highlighting](https://typesense.org/docs/29.0/api/search.html#highlighting)</code>
* \[TS‑Pagination] Typesense — Pagination (on Search Parameters page): <code>[https://typesense.org/docs/29.0/api/search.html#pagination](https://typesense.org/docs/29.0/api/search.html#pagination)</code>
* \[TS‑Grouping] Typesense — Grouping results: <code>[https://typesense.org/docs/29.0/api/search.html#grouping](https://typesense.org/docs/29.0/api/search.html#grouping)</code>
* \[TS‑MultiSearch] Typesense — Multi‑Search API: <code>[https://typesense.org/docs/29.0/api/multi-search.html](https://typesense.org/docs/29.0/api/multi-search.html)</code>
* \[TS‑Synonyms] Typesense — Synonyms API: <code>[https://typesense.org/docs/29.0/api/synonyms.html](https://typesense.org/docs/29.0/api/synonyms.html)</code>
* \[TS‑Stopwords] Typesense — Stopwords API: <code>[https://typesense.org/docs/29.0/api/stopwords.html](https://typesense.org/docs/29.0/api/stopwords.html)</code>
* \[TS‑FieldTypes] Typesense — Field types (<code>geopoint</code>): <code>[https://typesense.org/docs/29.0/api/field-types.html](https://typesense.org/docs/29.0/api/field-types.html)</code>
* \[TS‑Geo] Typesense — Geo search (see Search Parameters and guides): <code>[https://typesense.org/docs/29.0/api/search.html#geosearch](https://typesense.org/docs/29.0/api/search.html#geosearch)</code>
* \[TS‑Vector] Typesense — Vector Search: <code>[https://typesense.org/docs/29.0/api/vector-search.html](https://typesense.org/docs/29.0/api/vector-search.html)</code>
