From 71ebea68e6a5c5e17d3bc4e79dc3a5b32323a400 Mon Sep 17 00:00:00 2001 From: Luis Araujo <7045685+luis-araujo-dev@users.noreply.github.com> Date: Wed, 27 May 2026 10:26:34 +0100 Subject: [PATCH 1/6] update open api --- openapi.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/openapi.yml b/openapi.yml index bb13b53..6210f2a 100644 --- a/openapi.yml +++ b/openapi.yml @@ -2479,9 +2479,8 @@ components: description: > Optional details about the collection, e.g., when it was created, who created it etc. CollectionUpdateSchema: - required: - - fields type: object + minProperties: 1 properties: fields: type: array @@ -2724,7 +2723,7 @@ components: items: $ref: "#/components/schemas/SearchResultHit" request_params: - $ref: "#/components/schemas/SearchRequestParams" + $ref: "#/components/schemas/SearchRequestParams" conversation: $ref: "#/components/schemas/SearchResultConversation" union_request_params: @@ -2745,6 +2744,8 @@ components: properties: collection_name: type: string + first_q: + type: string q: type: string per_page: @@ -3073,6 +3074,13 @@ components: against. Multiple fields are separated with a comma. type: string + 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 + nl_query: description: Whether to use natural language processing to parse the query. type: boolean @@ -3845,6 +3853,13 @@ components: description: > The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. type: string + 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 + MultiSearchSearchesParameter: type: object required: @@ -3895,6 +3910,8 @@ components: type: object field_name: type: string + sampled: + type: boolean stats: type: object properties: From 51ebd719442deb605872a1d1eb7cadcd33f255db Mon Sep 17 00:00:00 2001 From: Luis Araujo <7045685+luis-araujo-dev@users.noreply.github.com> Date: Wed, 27 May 2026 10:33:03 +0100 Subject: [PATCH 2/6] pre process open api --- preprocessed_openapi.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/preprocessed_openapi.yml b/preprocessed_openapi.yml index a195bb0..5c06a3b 100644 --- a/preprocessed_openapi.yml +++ b/preprocessed_openapi.yml @@ -432,6 +432,12 @@ paths: schema: type: string description: A list of `string` fields that should be queried against. Multiple fields are separated with a comma. + - name: validate_field_names + in: query + schema: + type: boolean + 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. - name: nl_query in: query schema: @@ -2435,6 +2441,12 @@ paths: type: string description: | The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. + - name: validate_field_names + in: query + schema: + type: boolean + 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. requestBody: content: application/json: @@ -3271,8 +3283,6 @@ components: x-rust-has-lifetime: true CollectionUpdateSchema: type: object - required: - - fields properties: fields: type: array @@ -3299,6 +3309,7 @@ components: type: object description: | Optional details about the collection, e.g., when it was created, who created it etc. + minProperties: 1 CollectionResponse: allOf: - $ref: '#/components/schemas/CollectionSchema' @@ -3535,6 +3546,8 @@ components: properties: collection_name: type: string + first_q: + type: string q: type: string per_page: @@ -3864,6 +3877,10 @@ components: query_by: type: string description: A list of `string` fields that should be queried against. Multiple fields are separated with a comma. + validate_field_names: + type: boolean + 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. nl_query: type: boolean description: Whether to use natural language processing to parse the query. @@ -4379,6 +4396,10 @@ components: type: string description: | The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. + validate_field_names: + type: boolean + 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. x-rust-builder: true x-rust-has-lifetime: true MultiSearchSearchesParameter: @@ -4434,6 +4455,8 @@ components: type: object field_name: type: string + sampled: + type: boolean stats: type: object properties: From 09dbde72ef00d54e34e709d12cdd9647fb1f77fb Mon Sep 17 00:00:00 2001 From: Luis Araujo <7045685+luis-araujo-dev@users.noreply.github.com> Date: Wed, 27 May 2026 10:34:28 +0100 Subject: [PATCH 3/6] code gen --- typesense_codegen/.openapi-generator/VERSION | 2 +- typesense_codegen/README.md | 2 +- typesense_codegen/docs/CollectionUpdateSchema.md | 2 +- typesense_codegen/docs/DocumentsApi.md | 6 ++++-- typesense_codegen/docs/FacetCounts.md | 1 + typesense_codegen/docs/MultiSearchCollectionParameters.md | 1 + typesense_codegen/docs/MultiSearchParameters.md | 1 + typesense_codegen/docs/SearchParameters.md | 1 + typesense_codegen/docs/SearchRequestParams.md | 1 + typesense_codegen/src/apis/documents_api.rs | 8 ++++++++ typesense_codegen/src/models/collection_update_schema.rs | 8 ++++---- .../src/models/create_analytics_rule_200_response.rs | 4 +++- .../src/models/create_analytics_rule_request.rs | 2 +- typesense_codegen/src/models/facet_counts.rs | 3 +++ .../src/models/multi_search_collection_parameters.rs | 7 +++++++ typesense_codegen/src/models/multi_search_parameters.rs | 7 +++++++ typesense_codegen/src/models/search_parameters.rs | 7 +++++++ typesense_codegen/src/models/search_request_params.rs | 3 +++ 18 files changed, 55 insertions(+), 11 deletions(-) diff --git a/typesense_codegen/.openapi-generator/VERSION b/typesense_codegen/.openapi-generator/VERSION index 2fb556b..ca7bf6e 100644 --- a/typesense_codegen/.openapi-generator/VERSION +++ b/typesense_codegen/.openapi-generator/VERSION @@ -1 +1 @@ -7.18.0-SNAPSHOT +7.23.0-SNAPSHOT diff --git a/typesense_codegen/README.md b/typesense_codegen/README.md index a245a8d..5d68c71 100644 --- a/typesense_codegen/README.md +++ b/typesense_codegen/README.md @@ -9,7 +9,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat - API version: 30.0 - Package version: 30.0 -- Generator version: 7.14.0 +- Generator version: 7.23.0-SNAPSHOT - Build package: `org.openapitools.codegen.languages.RustClientCodegen` ## Installation diff --git a/typesense_codegen/docs/CollectionUpdateSchema.md b/typesense_codegen/docs/CollectionUpdateSchema.md index 6167d13..adf4087 100644 --- a/typesense_codegen/docs/CollectionUpdateSchema.md +++ b/typesense_codegen/docs/CollectionUpdateSchema.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**fields** | [**Vec**](Field.md) | A list of fields for querying, filtering and faceting | +**fields** | Option<[**Vec**](Field.md)> | A list of fields for querying, filtering and faceting | [optional] **synonym_sets** | Option<**Vec**> | List of synonym set names to associate with this collection | [optional] **metadata** | Option<[**serde_json::Value**](.md)> | Optional details about the collection, e.g., when it was created, who created it etc. | [optional] diff --git a/typesense_codegen/docs/DocumentsApi.md b/typesense_codegen/docs/DocumentsApi.md index bb5d379..d83fa07 100644 --- a/typesense_codegen/docs/DocumentsApi.md +++ b/typesense_codegen/docs/DocumentsApi.md @@ -218,7 +218,7 @@ Name | Type | Description | Required | Notes ## multi_search -> models::MultiSearchResult multi_search(q, query_by, query_by_weights, text_match_type, prefix, infix, max_extra_prefix, max_extra_suffix, filter_by, sort_by, facet_by, max_facet_values, facet_query, num_typos, page, per_page, limit, offset, group_by, group_limit, group_missing_values, include_fields, exclude_fields, highlight_full_fields, highlight_affix_num_tokens, highlight_start_tag, highlight_end_tag, snippet_threshold, drop_tokens_threshold, drop_tokens_mode, typo_tokens_threshold, enable_typos_for_alpha_numerical_tokens, filter_curated_hits, enable_synonyms, enable_analytics, synonym_prefix, synonym_num_typos, pinned_hits, hidden_hits, curation_tags, highlight_fields, pre_segmented_query, preset, enable_curations, prioritize_exact_match, prioritize_token_position, prioritize_num_matching_fields, enable_typos_for_numerical_tokens, exhaustive_search, search_cutoff_ms, use_cache, cache_ttl, min_len_1typo, min_len_2typo, vector_query, remote_embedding_timeout_ms, remote_embedding_num_tries, facet_strategy, stopwords, facet_return_parent, voice_query, conversation, conversation_model_id, conversation_id, multi_search_searches_parameter) +> models::MultiSearchResult multi_search(q, query_by, query_by_weights, text_match_type, prefix, infix, max_extra_prefix, max_extra_suffix, filter_by, sort_by, facet_by, max_facet_values, facet_query, num_typos, page, per_page, limit, offset, group_by, group_limit, group_missing_values, include_fields, exclude_fields, highlight_full_fields, highlight_affix_num_tokens, highlight_start_tag, highlight_end_tag, snippet_threshold, drop_tokens_threshold, drop_tokens_mode, typo_tokens_threshold, enable_typos_for_alpha_numerical_tokens, filter_curated_hits, enable_synonyms, enable_analytics, synonym_prefix, synonym_num_typos, pinned_hits, hidden_hits, curation_tags, highlight_fields, pre_segmented_query, preset, enable_curations, prioritize_exact_match, prioritize_token_position, prioritize_num_matching_fields, enable_typos_for_numerical_tokens, exhaustive_search, search_cutoff_ms, use_cache, cache_ttl, min_len_1typo, min_len_2typo, vector_query, remote_embedding_timeout_ms, remote_embedding_num_tries, facet_strategy, stopwords, facet_return_parent, voice_query, conversation, conversation_model_id, conversation_id, validate_field_names, multi_search_searches_parameter) send multiple search requests in a single HTTP request This is especially useful to avoid round-trip network latencies incurred otherwise if each of these requests are sent in separate HTTP requests. You can also use this feature to do a federated search across multiple collections in a single HTTP request. @@ -292,6 +292,7 @@ Name | Type | Description | Required | Notes **conversation** | Option<**bool**> | | | **conversation_model_id** | Option<**String**> | | | **conversation_id** | Option<**String**> | | | +**validate_field_names** | Option<**bool**> | | | **multi_search_searches_parameter** | Option<[**MultiSearchSearchesParameter**](MultiSearchSearchesParameter.md)> | | | ### Return type @@ -312,7 +313,7 @@ Name | Type | Description | Required | Notes ## search_collection -> models::SearchResult search_collection(collection_name, q, query_by, nl_query, nl_model_id, query_by_weights, text_match_type, prefix, infix, max_extra_prefix, max_extra_suffix, filter_by, max_filter_by_candidates, sort_by, facet_by, max_facet_values, facet_query, num_typos, page, per_page, limit, offset, group_by, group_limit, group_missing_values, include_fields, exclude_fields, highlight_full_fields, highlight_affix_num_tokens, highlight_start_tag, highlight_end_tag, enable_highlight_v1, enable_analytics, snippet_threshold, synonym_sets, drop_tokens_threshold, drop_tokens_mode, typo_tokens_threshold, enable_typos_for_alpha_numerical_tokens, filter_curated_hits, enable_synonyms, synonym_prefix, synonym_num_typos, pinned_hits, hidden_hits, curation_tags, highlight_fields, split_join_tokens, pre_segmented_query, preset, enable_curations, prioritize_exact_match, max_candidates, prioritize_token_position, prioritize_num_matching_fields, enable_typos_for_numerical_tokens, exhaustive_search, search_cutoff_ms, use_cache, cache_ttl, min_len_1typo, min_len_2typo, vector_query, remote_embedding_timeout_ms, remote_embedding_num_tries, facet_strategy, stopwords, facet_return_parent, voice_query, conversation, conversation_model_id, conversation_id) +> models::SearchResult search_collection(collection_name, q, query_by, validate_field_names, nl_query, nl_model_id, query_by_weights, text_match_type, prefix, infix, max_extra_prefix, max_extra_suffix, filter_by, max_filter_by_candidates, sort_by, facet_by, max_facet_values, facet_query, num_typos, page, per_page, limit, offset, group_by, group_limit, group_missing_values, include_fields, exclude_fields, highlight_full_fields, highlight_affix_num_tokens, highlight_start_tag, highlight_end_tag, enable_highlight_v1, enable_analytics, snippet_threshold, synonym_sets, drop_tokens_threshold, drop_tokens_mode, typo_tokens_threshold, enable_typos_for_alpha_numerical_tokens, filter_curated_hits, enable_synonyms, synonym_prefix, synonym_num_typos, pinned_hits, hidden_hits, curation_tags, highlight_fields, split_join_tokens, pre_segmented_query, preset, enable_curations, prioritize_exact_match, max_candidates, prioritize_token_position, prioritize_num_matching_fields, enable_typos_for_numerical_tokens, exhaustive_search, search_cutoff_ms, use_cache, cache_ttl, min_len_1typo, min_len_2typo, vector_query, remote_embedding_timeout_ms, remote_embedding_num_tries, facet_strategy, stopwords, facet_return_parent, voice_query, conversation, conversation_model_id, conversation_id) Search for documents in a collection Search for documents in a collection that match the search criteria. @@ -325,6 +326,7 @@ Name | Type | Description | Required | Notes **collection_name** | **String** | The name of the collection to search for the document under | [required] | **q** | Option<**String**> | | | **query_by** | Option<**String**> | | | +**validate_field_names** | Option<**bool**> | | | **nl_query** | Option<**bool**> | | | **nl_model_id** | Option<**String**> | | | **query_by_weights** | Option<**String**> | | | diff --git a/typesense_codegen/docs/FacetCounts.md b/typesense_codegen/docs/FacetCounts.md index 4b170c1..cacfa3d 100644 --- a/typesense_codegen/docs/FacetCounts.md +++ b/typesense_codegen/docs/FacetCounts.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **counts** | Option<[**Vec**](FacetCounts_counts_inner.md)> | | [optional] **field_name** | Option<**String**> | | [optional] +**sampled** | Option<**bool**> | | [optional] **stats** | Option<[**models::FacetCountsStats**](FacetCounts_stats.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/typesense_codegen/docs/MultiSearchCollectionParameters.md b/typesense_codegen/docs/MultiSearchCollectionParameters.md index 5776b94..31b297e 100644 --- a/typesense_codegen/docs/MultiSearchCollectionParameters.md +++ b/typesense_codegen/docs/MultiSearchCollectionParameters.md @@ -68,6 +68,7 @@ Name | Type | Description | Notes **conversation** | Option<**bool**> | Enable conversational search. | [optional] **conversation_model_id** | Option<**String**> | The Id of Conversation Model to be used. | [optional] **conversation_id** | Option<**String**> | The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. | [optional] +**validate_field_names** | Option<**bool**> | 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. | [optional] **collection** | Option<**String**> | The collection to search in. | [optional] **x_typesense_api_key** | Option<**String**> | A separate search API key for each search within a multi_search request | [optional] **rerank_hybrid_matches** | Option<**bool**> | When true, computes both text match and vector distance scores for all matches in hybrid search. Documents found only through keyword search will get a vector distance score, and documents found only through vector search will get a text match score. | [optional][default to false] diff --git a/typesense_codegen/docs/MultiSearchParameters.md b/typesense_codegen/docs/MultiSearchParameters.md index 04f82be..4171d58 100644 --- a/typesense_codegen/docs/MultiSearchParameters.md +++ b/typesense_codegen/docs/MultiSearchParameters.md @@ -68,6 +68,7 @@ Name | Type | Description | Notes **conversation** | Option<**bool**> | Enable conversational search. | [optional] **conversation_model_id** | Option<**String**> | The Id of Conversation Model to be used. | [optional] **conversation_id** | Option<**String**> | The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. | [optional] +**validate_field_names** | Option<**bool**> | 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. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/typesense_codegen/docs/SearchParameters.md b/typesense_codegen/docs/SearchParameters.md index d016971..057a38c 100644 --- a/typesense_codegen/docs/SearchParameters.md +++ b/typesense_codegen/docs/SearchParameters.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **q** | Option<**String**> | The query text to search for in the collection. Use * as the search string to return all documents. This is typically useful when used in conjunction with filter_by. | [optional] **query_by** | Option<**String**> | A list of `string` fields that should be queried against. Multiple fields are separated with a comma. | [optional] +**validate_field_names** | Option<**bool**> | 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. | [optional] **nl_query** | Option<**bool**> | Whether to use natural language processing to parse the query. | [optional] **nl_model_id** | Option<**String**> | The ID of the natural language model to use. | [optional] **query_by_weights** | Option<**String**> | The relative weight to give each `query_by` field when ranking results. This can be used to boost fields in priority, when looking for matches. Multiple fields are separated with a comma. | [optional] diff --git a/typesense_codegen/docs/SearchRequestParams.md b/typesense_codegen/docs/SearchRequestParams.md index 57bed91..5eedf99 100644 --- a/typesense_codegen/docs/SearchRequestParams.md +++ b/typesense_codegen/docs/SearchRequestParams.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **collection_name** | **String** | | +**first_q** | Option<**String**> | | [optional] **q** | **String** | | **per_page** | **i32** | | **voice_query** | Option<[**models::SearchRequestParamsVoiceQuery**](SearchRequestParams_voice_query.md)> | | [optional] diff --git a/typesense_codegen/src/apis/documents_api.rs b/typesense_codegen/src/apis/documents_api.rs index 749325a..df8693d 100644 --- a/typesense_codegen/src/apis/documents_api.rs +++ b/typesense_codegen/src/apis/documents_api.rs @@ -148,6 +148,7 @@ pub struct MultiSearchParams<'p> { pub conversation: Option, pub conversation_model_id: Option>, pub conversation_id: Option>, + pub validate_field_names: Option, pub multi_search_searches_parameter: Option>, } @@ -158,6 +159,7 @@ pub struct SearchCollectionParams<'p> { pub collection_name: Cow<'p, str>, pub q: Option>, pub query_by: Option>, + pub validate_field_names: Option, pub nl_query: Option, pub nl_model_id: Option>, pub query_by_weights: Option>, @@ -963,6 +965,9 @@ pub async fn multi_search( if let Some(ref param_value) = params.conversation_id { req_builder = req_builder.query(&[("conversation_id", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.validate_field_names { + req_builder = req_builder.query(&[("validate_field_names", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1031,6 +1036,9 @@ pub async fn search_collection serde::Deserialize<'de> + Serialize>( if let Some(ref param_value) = params.query_by { req_builder = req_builder.query(&[("query_by", ¶m_value.to_string())]); } + if let Some(ref param_value) = params.validate_field_names { + req_builder = req_builder.query(&[("validate_field_names", ¶m_value.to_string())]); + } if let Some(ref param_value) = params.nl_query { req_builder = req_builder.query(&[("nl_query", ¶m_value.to_string())]); } diff --git a/typesense_codegen/src/models/collection_update_schema.rs b/typesense_codegen/src/models/collection_update_schema.rs index c539a7a..08a1664 100644 --- a/typesense_codegen/src/models/collection_update_schema.rs +++ b/typesense_codegen/src/models/collection_update_schema.rs @@ -15,8 +15,8 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionUpdateSchema { /// A list of fields for querying, filtering and faceting - #[serde(rename = "fields")] - pub fields: Vec, + #[serde(rename = "fields", skip_serializing_if = "Option::is_none")] + pub fields: Option>, /// List of synonym set names to associate with this collection #[serde(rename = "synonym_sets", skip_serializing_if = "Option::is_none")] pub synonym_sets: Option>, @@ -26,9 +26,9 @@ pub struct CollectionUpdateSchema { } impl CollectionUpdateSchema { - pub fn new(fields: Vec) -> Self { + pub fn new() -> Self { Self { - fields, + fields: None, synonym_sets: None, metadata: None, } diff --git a/typesense_codegen/src/models/create_analytics_rule_200_response.rs b/typesense_codegen/src/models/create_analytics_rule_200_response.rs index 3e9311e..4de7904 100644 --- a/typesense_codegen/src/models/create_analytics_rule_200_response.rs +++ b/typesense_codegen/src/models/create_analytics_rule_200_response.rs @@ -16,7 +16,9 @@ use serde::{Deserialize, Serialize}; #[serde(untagged)] pub enum CreateAnalyticsRule200Response { AnalyticsRule(Box), - Array(Vec), + ArrayVeccreateAnalyticsRule_200_response_oneOf_inner( + Vec, + ), } impl Default for CreateAnalyticsRule200Response { diff --git a/typesense_codegen/src/models/create_analytics_rule_request.rs b/typesense_codegen/src/models/create_analytics_rule_request.rs index f8fe485..5c506aa 100644 --- a/typesense_codegen/src/models/create_analytics_rule_request.rs +++ b/typesense_codegen/src/models/create_analytics_rule_request.rs @@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize}; #[serde(untagged)] pub enum CreateAnalyticsRuleRequest<'a> { AnalyticsRuleCreate(Box>), - Array(Vec>), + ArrayVecAnalyticsRuleCreate(Vec>), } impl Default for CreateAnalyticsRuleRequest<'_> { diff --git a/typesense_codegen/src/models/facet_counts.rs b/typesense_codegen/src/models/facet_counts.rs index fd3eca8..43ee6de 100644 --- a/typesense_codegen/src/models/facet_counts.rs +++ b/typesense_codegen/src/models/facet_counts.rs @@ -18,6 +18,8 @@ pub struct FacetCounts { pub counts: Option>, #[serde(rename = "field_name", skip_serializing_if = "Option::is_none")] pub field_name: Option, + #[serde(rename = "sampled", skip_serializing_if = "Option::is_none")] + pub sampled: Option, #[serde(rename = "stats", skip_serializing_if = "Option::is_none")] pub stats: Option>, } @@ -27,6 +29,7 @@ impl FacetCounts { Self { counts: None, field_name: None, + sampled: None, stats: None, } } diff --git a/typesense_codegen/src/models/multi_search_collection_parameters.rs b/typesense_codegen/src/models/multi_search_collection_parameters.rs index cf07449..b8f681d 100644 --- a/typesense_codegen/src/models/multi_search_collection_parameters.rs +++ b/typesense_codegen/src/models/multi_search_collection_parameters.rs @@ -259,6 +259,12 @@ pub struct MultiSearchCollectionParameters<'a> { /// The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. #[serde(rename = "conversation_id", skip_serializing_if = "Option::is_none")] pub conversation_id: Option>, + /// 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. + #[serde( + rename = "validate_field_names", + skip_serializing_if = "Option::is_none" + )] + pub validate_field_names: Option, /// The collection to search in. #[serde(rename = "collection", skip_serializing_if = "Option::is_none")] pub collection: Option>, @@ -343,6 +349,7 @@ impl<'a> MultiSearchCollectionParameters<'a> { conversation: None, conversation_model_id: None, conversation_id: None, + validate_field_names: None, collection: None, x_typesense_api_key: None, rerank_hybrid_matches: None, diff --git a/typesense_codegen/src/models/multi_search_parameters.rs b/typesense_codegen/src/models/multi_search_parameters.rs index 05738a2..5f82689 100644 --- a/typesense_codegen/src/models/multi_search_parameters.rs +++ b/typesense_codegen/src/models/multi_search_parameters.rs @@ -260,6 +260,12 @@ pub struct MultiSearchParameters<'a> { /// The Id of a previous conversation to continue, this tells Typesense to include prior context when communicating with the LLM. #[serde(rename = "conversation_id", skip_serializing_if = "Option::is_none")] pub conversation_id: Option>, + /// 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. + #[serde( + rename = "validate_field_names", + skip_serializing_if = "Option::is_none" + )] + pub validate_field_names: Option, } impl<'a> MultiSearchParameters<'a> { @@ -330,6 +336,7 @@ impl<'a> MultiSearchParameters<'a> { conversation: None, conversation_model_id: None, conversation_id: None, + validate_field_names: None, } } } diff --git a/typesense_codegen/src/models/search_parameters.rs b/typesense_codegen/src/models/search_parameters.rs index 7eb2c56..31a1c61 100644 --- a/typesense_codegen/src/models/search_parameters.rs +++ b/typesense_codegen/src/models/search_parameters.rs @@ -23,6 +23,12 @@ pub struct SearchParameters<'a> { /// A list of `string` fields that should be queried against. Multiple fields are separated with a comma. #[serde(rename = "query_by", skip_serializing_if = "Option::is_none")] pub query_by: Option>, + /// 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. + #[serde( + rename = "validate_field_names", + skip_serializing_if = "Option::is_none" + )] + pub validate_field_names: Option, /// Whether to use natural language processing to parse the query. #[serde(rename = "nl_query", skip_serializing_if = "Option::is_none")] pub nl_query: Option, @@ -293,6 +299,7 @@ impl<'a> SearchParameters<'a> { Self { q: None, query_by: None, + validate_field_names: None, nl_query: None, nl_model_id: None, query_by_weights: None, diff --git a/typesense_codegen/src/models/search_request_params.rs b/typesense_codegen/src/models/search_request_params.rs index 4fa0b55..2790c79 100644 --- a/typesense_codegen/src/models/search_request_params.rs +++ b/typesense_codegen/src/models/search_request_params.rs @@ -16,6 +16,8 @@ use serde::{Deserialize, Serialize}; pub struct SearchRequestParams { #[serde(rename = "collection_name")] pub collection_name: String, + #[serde(rename = "first_q", skip_serializing_if = "Option::is_none")] + pub first_q: Option, #[serde(rename = "q")] pub q: String, #[serde(rename = "per_page")] @@ -28,6 +30,7 @@ impl SearchRequestParams { pub fn new(collection_name: String, q: String, per_page: i32) -> Self { Self { collection_name, + first_q: None, q, per_page, voice_query: None, From a61f593cd4c9c6c7cff84cd53cfe0dd5ce565889 Mon Sep 17 00:00:00 2001 From: Luis Araujo <7045685+luis-araujo-dev@users.noreply.github.com> Date: Wed, 27 May 2026 10:42:07 +0100 Subject: [PATCH 4/6] pass validate field names on search --- typesense/src/client/collection/documents.rs | 1 + typesense/src/client/multi_search.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/typesense/src/client/collection/documents.rs b/typesense/src/client/collection/documents.rs index e9a0b79..2dd042a 100644 --- a/typesense/src/client/collection/documents.rs +++ b/typesense/src/client/collection/documents.rs @@ -207,6 +207,7 @@ where text_match_type: params.text_match_type, typo_tokens_threshold: params.typo_tokens_threshold, use_cache: params.use_cache, + validate_field_names: params.validate_field_names, vector_query: params.vector_query, voice_query: params.voice_query, nl_model_id: params.nl_model_id, diff --git a/typesense/src/client/multi_search.rs b/typesense/src/client/multi_search.rs index a4cb533..dbe4023 100644 --- a/typesense/src/client/multi_search.rs +++ b/typesense/src/client/multi_search.rs @@ -341,6 +341,7 @@ fn build_multi_search_params<'a>( text_match_type: params.text_match_type, typo_tokens_threshold: params.typo_tokens_threshold, use_cache: params.use_cache, + validate_field_names: params.validate_field_names, vector_query: params.vector_query, voice_query: params.voice_query, enable_analytics: params.enable_analytics, From ef03ce81c7d42dbcb5498f58cb9c1f91ee590a82 Mon Sep 17 00:00:00 2001 From: Luis Araujo <7045685+luis-araujo-dev@users.noreply.github.com> Date: Wed, 27 May 2026 10:59:06 +0100 Subject: [PATCH 5/6] revert changes unrelated with open api spec changes --- .../src/models/create_analytics_rule_200_response.rs | 4 +--- typesense_codegen/src/models/create_analytics_rule_request.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/typesense_codegen/src/models/create_analytics_rule_200_response.rs b/typesense_codegen/src/models/create_analytics_rule_200_response.rs index 4de7904..3e9311e 100644 --- a/typesense_codegen/src/models/create_analytics_rule_200_response.rs +++ b/typesense_codegen/src/models/create_analytics_rule_200_response.rs @@ -16,9 +16,7 @@ use serde::{Deserialize, Serialize}; #[serde(untagged)] pub enum CreateAnalyticsRule200Response { AnalyticsRule(Box), - ArrayVeccreateAnalyticsRule_200_response_oneOf_inner( - Vec, - ), + Array(Vec), } impl Default for CreateAnalyticsRule200Response { diff --git a/typesense_codegen/src/models/create_analytics_rule_request.rs b/typesense_codegen/src/models/create_analytics_rule_request.rs index 5c506aa..f8fe485 100644 --- a/typesense_codegen/src/models/create_analytics_rule_request.rs +++ b/typesense_codegen/src/models/create_analytics_rule_request.rs @@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize}; #[serde(untagged)] pub enum CreateAnalyticsRuleRequest<'a> { AnalyticsRuleCreate(Box>), - ArrayVecAnalyticsRuleCreate(Vec>), + Array(Vec>), } impl Default for CreateAnalyticsRuleRequest<'_> { From bde104aad0056127fdedc65ddbfe94ad03e829fa Mon Sep 17 00:00:00 2001 From: Luis Araujo <7045685+luis-araujo-dev@users.noreply.github.com> Date: Wed, 27 May 2026 11:02:45 +0100 Subject: [PATCH 6/6] fix compilation issue on tests --- typesense/tests/client/collections_test.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/typesense/tests/client/collections_test.rs b/typesense/tests/client/collections_test.rs index 7c2ba47..1c17748 100644 --- a/typesense/tests/client/collections_test.rs +++ b/typesense/tests/client/collections_test.rs @@ -64,7 +64,7 @@ async fn logic_test_collections_and_collection_lifecycle() { // --- 5. Update the Collection to add and drop a field (via `collection`) --- let update_schema = CollectionUpdateSchema { - fields: vec![ + fields: Some(vec![ // Add a new field Field { name: "description".into(), @@ -78,7 +78,7 @@ async fn logic_test_collections_and_collection_lifecycle() { drop: Some(true), ..Default::default() }, - ], + ]), ..Default::default() }; @@ -91,8 +91,8 @@ async fn logic_test_collections_and_collection_lifecycle() { // The update response contains the fields that were modified let updated_fields_response = update_result.unwrap(); assert_eq!( - updated_fields_response.fields.len(), - 2, + updated_fields_response.fields.as_deref().map(<[_]>::len), + Some(2), "The update response should contain the two modified fields." );