From 0838159e7921bd0ca703d2c58ab123ac4b3b4545 Mon Sep 17 00:00:00 2001 From: Ivan Despot <66276597+g-despot@users.noreply.github.com> Date: Thu, 17 Sep 2026 10:53:19 +0200 Subject: [PATCH] docs(query): document that limit=0 uses the server's default limit `limit` is sent as a proto3 `uint32`, so `0` is indistinguishable from an omitted limit and the server applies its default. Say so on the `limit` argument of the query and generate search methods. --- weaviate/collections/queries/bm25/generate/executor.py | 2 +- weaviate/collections/queries/bm25/query/executor.py | 2 +- weaviate/collections/queries/fetch_objects/generate/executor.py | 2 +- weaviate/collections/queries/fetch_objects/query/executor.py | 2 +- weaviate/collections/queries/hybrid/generate/executor.py | 2 +- weaviate/collections/queries/hybrid/query/executor.py | 2 +- weaviate/collections/queries/near_image/generate/executor.py | 2 +- weaviate/collections/queries/near_image/query/executor.py | 2 +- weaviate/collections/queries/near_media/generate/executor.py | 2 +- weaviate/collections/queries/near_media/query/executor.py | 2 +- weaviate/collections/queries/near_object/generate/executor.py | 2 +- weaviate/collections/queries/near_object/query/executor.py | 2 +- weaviate/collections/queries/near_text/generate/executor.py | 2 +- weaviate/collections/queries/near_text/query/executor.py | 2 +- weaviate/collections/queries/near_vector/generate/executor.py | 2 +- weaviate/collections/queries/near_vector/query/executor.py | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/weaviate/collections/queries/bm25/generate/executor.py b/weaviate/collections/queries/bm25/generate/executor.py index 77bfbf045..85fe55799 100644 --- a/weaviate/collections/queries/bm25/generate/executor.py +++ b/weaviate/collections/queries/bm25/generate/executor.py @@ -392,7 +392,7 @@ def bm25( grouped_task: The prompt to use for RaG on the entire result set. grouped_properties: The properties to use in the RaG on the entire result set. query_properties: The properties to search in. If not specified, all properties are searched. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/bm25/query/executor.py b/weaviate/collections/queries/bm25/query/executor.py index 9cb3ec773..29e6c7ee1 100644 --- a/weaviate/collections/queries/bm25/query/executor.py +++ b/weaviate/collections/queries/bm25/query/executor.py @@ -325,7 +325,7 @@ def bm25( Args: query: The keyword-based query to search for, REQUIRED. If None, a normal search will be performed. query_properties: The properties to search in. If not specified, all properties are searched. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/fetch_objects/generate/executor.py b/weaviate/collections/queries/fetch_objects/generate/executor.py index 27b749ad7..06cd82bef 100644 --- a/weaviate/collections/queries/fetch_objects/generate/executor.py +++ b/weaviate/collections/queries/fetch_objects/generate/executor.py @@ -190,7 +190,7 @@ def fetch_objects( single_prompt: The prompt to use for RaG on each object individually. grouped_task: The prompt to use for RaG on the entire result set. grouped_properties: The properties to use in the RaG on the entire result set. - limit: The maximum number of results to return. If not specified, the default limit specified by Weaviate is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in Weaviate. after: The UUID of the object to start from. If not specified, the retrieval begins from the first object in Weaviate. filters: The filters to apply to the retrieval. diff --git a/weaviate/collections/queries/fetch_objects/query/executor.py b/weaviate/collections/queries/fetch_objects/query/executor.py index 821db44e6..2fbcd01b9 100644 --- a/weaviate/collections/queries/fetch_objects/query/executor.py +++ b/weaviate/collections/queries/fetch_objects/query/executor.py @@ -147,7 +147,7 @@ def fetch_objects( """Retrieve the objects in this collection without any search. Args: - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. after: The UUID of the object to start from. If not specified, the retrieval begins from the first object in the server. filters: The filters to apply to the retrieval. diff --git a/weaviate/collections/queries/hybrid/generate/executor.py b/weaviate/collections/queries/hybrid/generate/executor.py index 62a44b3ec..71c875bf5 100644 --- a/weaviate/collections/queries/hybrid/generate/executor.py +++ b/weaviate/collections/queries/hybrid/generate/executor.py @@ -486,7 +486,7 @@ def hybrid( vector: The specific vector to search for. If not specified, the query is vectorized and used in the similarity search. query_properties: The properties to search in. If not specified, all properties are searched. fusion_type: The type of fusion to apply. If not specified, the default fusion type specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/hybrid/query/executor.py b/weaviate/collections/queries/hybrid/query/executor.py index f3bd7af62..f97c0185d 100644 --- a/weaviate/collections/queries/hybrid/query/executor.py +++ b/weaviate/collections/queries/hybrid/query/executor.py @@ -419,7 +419,7 @@ def hybrid( vector: The specific vector to search for. If not specified, the query is vectorized and used in the similarity search. query_properties: The properties to search in. If not specified, all properties are searched. fusion_type: The type of fusion to apply. If not specified, the default fusion type specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. bm25_operator: The BM25 operator to use. If not specified, the default operator specified by the server is used. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. diff --git a/weaviate/collections/queries/near_image/generate/executor.py b/weaviate/collections/queries/near_image/generate/executor.py index e74cfb818..4eb74cb51 100644 --- a/weaviate/collections/queries/near_image/generate/executor.py +++ b/weaviate/collections/queries/near_image/generate/executor.py @@ -426,7 +426,7 @@ def near_image( near_image: The image file to search on, REQUIRED. This can be a base64 encoded string of the binary, a path to the file, or a file-like object. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_image/query/executor.py b/weaviate/collections/queries/near_image/query/executor.py index 38f7f5b85..b431e5e38 100644 --- a/weaviate/collections/queries/near_image/query/executor.py +++ b/weaviate/collections/queries/near_image/query/executor.py @@ -363,7 +363,7 @@ def near_image( near_image: The image file to search on, REQUIRED. This can be a base64 encoded string of the binary, a path to the file, or a file-like object. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_media/generate/executor.py b/weaviate/collections/queries/near_media/generate/executor.py index 894daad5e..3f3c93885 100644 --- a/weaviate/collections/queries/near_media/generate/executor.py +++ b/weaviate/collections/queries/near_media/generate/executor.py @@ -441,7 +441,7 @@ def near_media( media_type: The type of the provided media file, REQUIRED. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_media/query/executor.py b/weaviate/collections/queries/near_media/query/executor.py index c3a32a9c9..ccd0fc68f 100644 --- a/weaviate/collections/queries/near_media/query/executor.py +++ b/weaviate/collections/queries/near_media/query/executor.py @@ -378,7 +378,7 @@ def near_media( media_type: The type of the provided media file, REQUIRED. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_object/generate/executor.py b/weaviate/collections/queries/near_object/generate/executor.py index a7e6a89eb..ef53d3aa2 100644 --- a/weaviate/collections/queries/near_object/generate/executor.py +++ b/weaviate/collections/queries/near_object/generate/executor.py @@ -422,7 +422,7 @@ def near_object( near_object: The UUID of the object to search on, REQUIRED. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_object/query/executor.py b/weaviate/collections/queries/near_object/query/executor.py index 7dd894e09..d74ab5ba7 100644 --- a/weaviate/collections/queries/near_object/query/executor.py +++ b/weaviate/collections/queries/near_object/query/executor.py @@ -362,7 +362,7 @@ def near_object( near_object: The UUID of the object to search on, REQUIRED. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_text/generate/executor.py b/weaviate/collections/queries/near_text/generate/executor.py index 465679209..34be2a00b 100644 --- a/weaviate/collections/queries/near_text/generate/executor.py +++ b/weaviate/collections/queries/near_text/generate/executor.py @@ -453,7 +453,7 @@ def near_text( query: The text or texts to search on, REQUIRED. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_text/query/executor.py b/weaviate/collections/queries/near_text/query/executor.py index 10b924853..10894aa4a 100644 --- a/weaviate/collections/queries/near_text/query/executor.py +++ b/weaviate/collections/queries/near_text/query/executor.py @@ -390,7 +390,7 @@ def near_text( query: The text or texts to search on, REQUIRED. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_vector/generate/executor.py b/weaviate/collections/queries/near_vector/generate/executor.py index 2cef99f98..0774d5108 100644 --- a/weaviate/collections/queries/near_vector/generate/executor.py +++ b/weaviate/collections/queries/near_vector/generate/executor.py @@ -422,7 +422,7 @@ def near_vector( near_vector: The vector to search on, REQUIRED. This can be a base64 encoded string of the binary, a path to the file, or a file-like object. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search. diff --git a/weaviate/collections/queries/near_vector/query/executor.py b/weaviate/collections/queries/near_vector/query/executor.py index b352cca3b..788eea6ff 100644 --- a/weaviate/collections/queries/near_vector/query/executor.py +++ b/weaviate/collections/queries/near_vector/query/executor.py @@ -359,7 +359,7 @@ def near_vector( near_vector: The vector to search on, REQUIRED. This can be a base64 encoded string of the binary, a path to the file, or a file-like object. certainty: The minimum similarity score to return. If not specified, the default certainty specified by the server is used. distance: The maximum distance to search. If not specified, the default distance specified by the server is used. - limit: The maximum number of results to return. If not specified, the default limit specified by the server is returned. + limit: The maximum number of results to return. If not specified or set to `0`, the server's default limit is used. offset: The offset to start from. If not specified, the retrieval begins from the first object in the server. auto_limit: The maximum number of [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) results to return. If not specified, no limit is applied. filters: The filters to apply to the search.