From 4af167cd0fdeb31512b0236c7ac0a407c8c3f097 Mon Sep 17 00:00:00 2001 From: Hayden Hung Hoang Date: Mon, 23 Nov 2026 19:19:15 +0700 Subject: [PATCH 1/2] feat(openapi): add multi_search params read by v30.2 Add the documented search params the server reads to MultiSearchParameters, which both the query string and each entry of searches[] use: analytics_tag, diversity_lambda, enable_highlight_v1, max_candidates, the nl_* params, split_join_tokens and synonym_sets. The server copies the query string into every search before applying that search's own params, so the params it reads only from the query string (collection, limit_multi_searches, conversation_stream) go in MultiSearchParameters too, next to the conversation params already there. Clients that unwrap MultiSearchParameters into query params or pass it as the query object pick them up without changes. MultiSearchCollectionParameters no longer repeats collection, which it now gets from MultiSearchParameters. remove_duplicates sits next to union in the body. Also drop a stray backtick in the split_join_tokens description, in SearchParameters and in the copy added here. --- openapi.yml | 77 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 5 deletions(-) diff --git a/openapi.yml b/openapi.yml index bc78960..bf1e045 100644 --- a/openapi.yml +++ b/openapi.yml @@ -3384,7 +3384,7 @@ components: description: > Treat space as typo: search for q=basket ball if q=basketball is not found or vice-versa. Splitting/joining of tokens will only be attempted if the original query produces no results. - To always trigger this behavior, set value to `always``. + To always trigger this behavior, set value to `always`. To disable, set value to `off`. Default is `fallback`. type: string @@ -3543,6 +3543,20 @@ components: against. Multiple fields are separated with a comma. type: string + nl_query: + description: Whether to use natural language processing to parse the query. + type: boolean + + nl_model_id: + description: The ID of the natural language model to use. + type: string + + nl_query_prompt_cache_ttl: + description: > + How long (in seconds) the collection schema prompt sent to the natural language + model is cached. Default: 86400. + type: integer + query_by_weights: description: The relative weight to give each `query_by` field when ranking results. @@ -3723,6 +3737,13 @@ components: Default: `` type: string + enable_highlight_v1: + description: > + Flag for enabling/disabling the deprecated, old highlight structure in the response. + Default: true + type: boolean + default: true + snippet_threshold: description: > Field values under this length will be fully highlighted, instead of showing @@ -3758,6 +3779,11 @@ components: description: > If you have some synonyms defined but want to disable all of them for a particular search query, set enable_synonyms to false. Default: true + synonym_sets: + type: string + description: List of synonym set names to associate with this search query + example: "synonym_set_1,synonym_set_2" + enable_analytics: description: > Flag for enabling/disabling analytics aggregation for specific search @@ -3765,6 +3791,11 @@ components: type: boolean default: true + analytics_tag: + description: > + A tag recorded with the analytics events this search query generates. + type: string + synonym_prefix: type: boolean description: > @@ -3822,6 +3853,14 @@ components: documents found only through vector search will get a text match score. default: false + split_join_tokens: + description: > + Treat space as typo: search for q=basket ball if q=basketball is not found or vice-versa. + Splitting/joining of tokens will only be attempted if the original query produces no results. + To always trigger this behavior, set value to `always`. + To disable, set value to `off`. Default is `fallback`. + type: string + pre_segmented_query: description: > You can index content from any logographic language into Typesense if you @@ -3852,6 +3891,11 @@ components: type: boolean default: true + max_candidates: + description: > + Control the number of words that Typesense considers for typo and prefix searching. + type: integer + prioritize_token_position: description: > Make Typesense prioritize documents where the query words appear earlier in the text. @@ -3961,12 +4005,33 @@ components: description: > The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. type: string + conversation_stream: + description: > + When `conversation` is true, streams the response as server-sent events. + Only read from the query string. + type: boolean + collection: + description: > + The collection to search in. In the query string, it applies to each search + that doesn't name its own. + type: string + limit_multi_searches: + description: > + Maximum number of searches the request may contain. A value embedded in a scoped API key + overrides it. Only read from the query string. Default: 50. + type: integer validate_field_names: description: > Controls whether Typesense should validate if the fields exist in the schema. When set to false, Typesense will not throw an error if a field is missing. This is useful for programmatic grouping where not all fields may exist. type: boolean + diversity_lambda: + description: > + Balances relevance against diversity when a matching curation rule diversifies results: + 1 ranks purely by relevance, 0 purely by diversity. Values outside 0 to 1 fall back to the default. + Default: 0.5. + type: number MultiSearchSearchesParameter: type: object @@ -3977,6 +4042,12 @@ components: type: boolean default: false description: When true, merges the search results from each search query into a single ordered set of hits. + remove_duplicates: + type: boolean + default: true + description: > + When `union` is true, keeps only the highest-ranked hit of a document that more than one search returns. + Ignored when the searches use `group_by`. searches: type: array items: @@ -3986,10 +4057,6 @@ components: - $ref: "#/components/schemas/MultiSearchParameters" - type: object properties: - collection: - type: string - description: > - The collection to search in. x-typesense-api-key: type: string description: A separate search API key for each search within a multi_search request From ab207b6c5ffba2d22306e4009bbbe3dd488d0529 Mon Sep 17 00:00:00 2001 From: Hayden Hung Hoang Date: Mon, 23 Nov 2026 19:19:15 +0700 Subject: [PATCH 2/2] feat(openapi): add search params read by v30.2 Add the documented params GET /collections/{collectionName}/documents/search reads that SearchParameters lacked: analytics_tag, diversity_lambda and nl_query_prompt_cache_ttl. --- openapi.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/openapi.yml b/openapi.yml index bf1e045..d223e0c 100644 --- a/openapi.yml +++ b/openapi.yml @@ -3089,6 +3089,12 @@ components: description: The ID of the natural language model to use. type: string + nl_query_prompt_cache_ttl: + description: > + How long (in seconds) the collection schema prompt sent to the natural language + model is cached. Default: 86400. + type: integer + query_by_weights: description: The relative weight to give each `query_by` field when ranking results. @@ -3284,6 +3290,11 @@ components: type: boolean default: true + analytics_tag: + description: > + A tag recorded with the analytics events this search query generates. + type: string + snippet_threshold: description: > Field values under this length will be fully highlighted, instead of showing @@ -3526,6 +3537,12 @@ components: description: > The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. type: string + diversity_lambda: + description: > + Balances relevance against diversity when a matching curation rule diversifies results: + 1 ranks purely by relevance, 0 purely by diversity. Values outside 0 to 1 fall back to the default. + Default: 0.5. + type: number MultiSearchParameters: description: >