Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -2745,6 +2744,8 @@ components:
properties:
collection_name:
type: string
first_q:
type: string
q:
type: string
per_page:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -3895,6 +3910,8 @@ components:
type: object
field_name:
type: string
sampled:
type: boolean
stats:
type: object
properties:
Expand Down
27 changes: 25 additions & 2 deletions preprocessed_openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -3271,8 +3283,6 @@ components:
x-rust-has-lifetime: true
CollectionUpdateSchema:
type: object
required:
- fields
properties:
fields:
type: array
Expand All @@ -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'
Expand Down Expand Up @@ -3535,6 +3546,8 @@ components:
properties:
collection_name:
type: string
first_q:
type: string
q:
type: string
per_page:
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -4434,6 +4455,8 @@ components:
type: object
field_name:
type: string
sampled:
type: boolean
stats:
type: object
properties:
Expand Down
1 change: 1 addition & 0 deletions typesense/src/client/collection/documents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions typesense/src/client/multi_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions typesense/tests/client/collections_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -78,7 +78,7 @@ async fn logic_test_collections_and_collection_lifecycle() {
drop: Some(true),
..Default::default()
},
],
]),
..Default::default()
};

Expand All @@ -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."
);

Expand Down
2 changes: 1 addition & 1 deletion typesense_codegen/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.18.0-SNAPSHOT
7.23.0-SNAPSHOT
2 changes: 1 addition & 1 deletion typesense_codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion typesense_codegen/docs/CollectionUpdateSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**fields** | [**Vec<models::Field>**](Field.md) | A list of fields for querying, filtering and faceting |
**fields** | Option<[**Vec<models::Field>**](Field.md)> | A list of fields for querying, filtering and faceting | [optional]
**synonym_sets** | Option<**Vec<String>**> | 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]

Expand Down
6 changes: 4 additions & 2 deletions typesense_codegen/docs/DocumentsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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**> | | |
Expand Down
1 change: 1 addition & 0 deletions typesense_codegen/docs/FacetCounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**counts** | Option<[**Vec<models::FacetCountsCountsInner>**](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)
Expand Down
1 change: 1 addition & 0 deletions typesense_codegen/docs/MultiSearchCollectionParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions typesense_codegen/docs/MultiSearchParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions typesense_codegen/docs/SearchParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions typesense_codegen/docs/SearchRequestParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading
Loading