Subject: Unable to Modify Default Query Limits in Weaviate Deployment. Retreving only 100 results

I am facing an issue with my Weaviate deployment where I am unable to change the default query limits for search results. Despite adjusting both the QUERY_DEFAULTS_LIMIT and QUERY_MAXIMUM_RESULTS parameters in my configuration, as well as trying different values and even omitting them entirely, the number of search results returned by Weaviate remains fixed at 100.

Below is the relevant excerpt from my Weaviate configuration:

---
version: '3.4'
services:
  weaviate:
    command:
      - --host
      - 0.0.0.0
      - --port
      - '1000'
      - --scheme
      - http
    image: semitechnologies/weaviate:1.22.0
    ports:
      - "1000:1000"
    restart: on-failure:0
    volumes:
      - C:/backups:/tmp/backups
    environment:
      QUERY_DEFAULTS_LIMIT: 10000
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'none'
      ENABLE_MODULES: 'backup-filesystem,backup-s3'
      AWS_ACCESS_KEY_ID: ''
      AWS_SECRET_ACCESS_KEY: ''
      AWS_SESSION_TOKEN: ''
      AWS_REGION: 'us-east-1'
      BACKUP_S3_BUCKET: 'bucket-dev'
      BACKUP_S3_PATH: 'weaviate/backups/'
      BACKUP_S3_ENDPOINT: ''
      BACKUP_FILESYSTEM_PATH: '/tmp/backups'
      CLUSTER_HOSTNAME: 'node1'
      QUERY_MAXIMUM_RESULTS: 10000
      DISK_USE_READONLY_PERCENTAGE: 100
---

I would greatly appreciate any insights or suggestions on how to resolve this issue and successfully adjust the default query limits in Weaviate.

Thank you in advance for your assistance.

Hi @Sandip !

I was not able to reproduce part of this.

setting QUERY_MAXIMUM_RESULTS to 5, and adding 10000 objects:

import weaviate
client = weaviate.connect_to_local()

from weaviate import classes as wvc

collection = client.collections.create(
    name="TestQueryLimit",
    vectorizer_config=None,
    properties=[
        wvc.config.Property(name="text", data_type=wvc.config.DataType.TEXT)
    ]
)

from weaviate.util import generate_uuid5
objects = []
for i in range(10000):
    objects.append(
        wvc.data.DataObject(
            {"text": f"Object {i}"},
            uuid=generate_uuid5(f"item-{i}")
        )
    )

collection.data.insert_many(objects)

Now, whenever I query:

collection.query.bm25(query="Object", limit=3000)

I get the following error:

WeaviateQueryError: Query call with protocol GRPC search failed with message explorer: get class: vector search: invalid pagination params: query maximum results exceeded.

This is expected.

However, for QUERY_DEFAULTS_LIMIT I tried setting it to 25, and when performing a query using bm25, for example:

len(collection.query.bm25(query="Object", limit=None).objects)

it indeed didn’t respect that limit from server, and was only returning 10 objects by default.

the same happens for this query:

len(collection.query.fetch_objects().objects)

I will need to ask this internally and will get back here when I get an answer.

Thanks for reporting!

Hi @Sandip !

I found out that that limit, QUERY_DEFAULTS_LIMIT will only take effect at the rest endpoint, so:

http://localhost:8080/v1/objects

I understand that from a user perspective, setting that limit should take effect in all queries: rest, grpc and graphql.

I have raised that internally.

Thanks!

Hello!

Thank you for raising that problem internally, I am facing the same issue.

On the other hand, I was wondering if it would be possible to pass filters in the cursor api ?

Also, do you mind updating the doc: until the fix to GRPC i completed?

  • The number of objects you can retrieve is limited. A single query returns up to QUERY_MAXIMUM_RESULTS. If the sum of offset and limit exceeds QUERY_MAXIMUM_RESULTS, Weaviate returns an error. To change the limit, edit the QUERY_MAXIMUM_RESULTS environment variable. If you increase QUERY_MAXIMUM_RESULTS, use the lowest value possible to avoid performance problems.

Thank you!

Thanks for spotting this.

Note: Our team is working on clients so all queries get persistent with QUERY_DEFAULTS_LIMIT in server.

A fix should come soon :star_struck:

Hi! You cannot pass filter to the cursor api. as it will iterate over all objects.

If you want iterate over filtered objects, you will need to do a search:

The issue is not in GRPC nor Weaviate, but in the client that will be fixed soon.

What exactly would need changing on the doc? :thinking:

Hi, thanks for your answer!

What to do - if I need to go through the whole collection (more than 5 million objects) and filter by property (e.g. document type=‘pdf’) to process them?

If you use filter search - then limit + offset should be less than QUERY_MAXIMUM_RESULTS (which is 10_000 by default).

Should ‘QUERY_MAXIMUM_RESULTS’ be equal to the number of data in the database?

hi @vkrasnoselskikh !!

For now there isn’t a filter for all objects

And probably, if you want to get that, you will also need to increase GRPC_MAX_MESSAGE_SIZE at environment variable, as if not using pagination, you can reach that limit too :grimacing:

Let me know if this helps

Thank you for you answer @DudaNogueira !!

Since I use pagination (limit/offset), I don’t encounter GRPC_MAX_MESSAGE_SIZE.

But as soon asthe sum of limit + offset approaches 10_000 ( I didn’t change default QUERY_MAXIMUM_RESULTS), I get an error:

weaviate.exceptions.WeaviateQueryError: Query call with protocol GRPC search failed with message <AioRpcError of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "explorer: list class: search: invalid pagination params: query maximum results exceeded"
	debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"explorer: list class: search: invalid pagination params: query maximum results exceeded", grpc_status:2, created_time:"2025-08-15T14:02:22.05397+04:00"}"
>.

My code:

Document = client.collections.get('Document').with_tenant(tenant)

req = Document.query.fetch_objects(
    limit=10,
    offset=10_000,
    return_properties=['document_type'],
)

for _obj in req.objects: # raise  weaviate.exceptions.WeaviateQueryError
    print(_obj.uuid)

Where can I vote for the functionality: add to cursor_api or somewhere else the ability to bypass the collection with a simple (Equal) filter?

Or do I need to contribute this?

hi @vkrasnoselskikh !!

I believe it is best to create a new forum thread (or GH issue), stating the problem, a minimum reproducible code, the version you can reproduce, etc. And once we have this in place, request a feature.

Not sure I understood the feature request :thinking:

Do you want to add a filter to Read All Objects?

Thanks!

Yes, I think this will be the most expected (understandable) place for other users.

Oh! Great timing :slight_smile:

PR implementing this on Server: https://github.com/weaviate/weaviate/pull/8961

And here implementing on client, with some tests showing how to use it: Filter iterator by dirkkul ¡ Pull Request #1798 ¡ weaviate/weaviate-python-client ¡ GitHub

Hopefully this will bubble up on a next patch release!

Thanks!