I have searched the existing issues and discussions.
I am using the latest version of Open WebUI.
Installation Method
Docker
Open WebUI Version
0.6.18
Ollama Version (if applicable)
No response
Operating System
Ubuntu 24.04
Browser (if applicable)
No response
Confirmation
I have read and followed all instructions in README.md.
I am using the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
I have included the Docker container logs.
I have provided every relevant configuration, setting, and environment variable used in my setup.
I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
Start with the initial platform/version/OS and dependencies used,
Specify exact install/launch/configure commands,
List URLs visited, user input (incl. example values/emails/passwords if needed),
Describe all options and toggles enabled or changed,
Include any files or environmental changes,
Identify the expected and actual result at each stage,
Ensure any reasonably skilled user can follow and hit the same issue.
Expected Behavior
When querying more than 16384 entries, milvus.py should iterate queries and return top k entries
Actual Behavior
After the first iteration, offset is equal 16384 and limit 16384, resulting in error MilvusException: <MilvusException: (code=65535, message=invalid max query result window, (offset+limit) should be in range [1, 16384], but got 32 768)>
Steps to Reproduce
Have a collection > 16384 in milvus
RAG query on this collection
Logs & Screenshots
MilvusException: <MilvusException: (code=65535, message=invalid max query result window, (offset+limit) should be in range [1, 16384], but got 32 768)>
Additional Information
I edited milvus.py to use collection.query_iterator() instead of client.query()
Add in milvus.py : from pymilvus import connections, Collection
And change query to :
def query(self, collection_name: str, filter: dict, limit: Optional[int] = None):
connections.connect(uri=MILVUS_URI,token=MILVUS_TOKEN,db_name=MILVUS_DB)
if limit is None:
limit = ( 16384 * 10 )
collection_name = collection_name.replace("-", "_")
if not self.has_collection(collection_name):
log.warning(
f"Query attempted on non-existent collection: {self.collection_prefix}_{collection_name}"
)
return None
filter_string = " && ".join(
[
f'metadata["{key}"] == {json.dumps(value)}'
for key, value in filter.items()
]
)
collection=Collection(name=f"{self.collection_prefix}_{collection_name}")
collection.load()
all_results = []
try:
log.info(
f"Querying collection {self.collection_prefix}_{collection_name} with filter: '{filter_string}', limit: {limit}"
)
# Use query_iterator to efficiently handle potentially large result sets
iterator = collection.query_iterator(
filter=filter_string,
output_fields=[
"id",
"data",
"metadata",
],
limit=limit, # Pass the limit directly; None means no limit.
)
# The iterator yields results in batches
results = []
while True:
result = iterator.next()
if not result:
iterator.close()
break
all_results += result
log.info(f"Total results from query: {len(all_results)}")
return self._result_to_get_result([all_results])
except Exception as e:
log.exception(
f"Error querying collection {self.collection_prefix}_{collection_name} with filter '{filter_string}' and limit {limit}: {e}"
)
return None
Now iteration works and we get the expected top k result
Originally created by @julien-oss on GitHub (Aug 6, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16324
### Check Existing Issues
- [x] I have searched the existing issues and discussions.
- [x] I am using the latest version of Open WebUI.
### Installation Method
Docker
### Open WebUI Version
0.6.18
### Ollama Version (if applicable)
_No response_
### Operating System
Ubuntu 24.04
### Browser (if applicable)
_No response_
### Confirmation
- [x] I have read and followed all instructions in `README.md`.
- [x] I am using the latest version of **both** Open WebUI and Ollama.
- [x] I have included the browser console logs.
- [x] I have included the Docker container logs.
- [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.**
- [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
- [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps:
- Start with the initial platform/version/OS and dependencies used,
- Specify exact install/launch/configure commands,
- List URLs visited, user input (incl. example values/emails/passwords if needed),
- Describe all options and toggles enabled or changed,
- Include any files or environmental changes,
- Identify the expected and actual result at each stage,
- Ensure any reasonably skilled user can follow and hit the same issue.
### Expected Behavior
When querying more than 16384 entries, milvus.py should iterate queries and return top k entries
### Actual Behavior
After the first iteration, offset is equal 16384 and limit 16384, resulting in error `MilvusException: <MilvusException: (code=65535, message=invalid max query result window, (offset+limit) should be in range [1, 16384], but got 32 768)>
`
### Steps to Reproduce
Have a collection > 16384 in milvus
RAG query on this collection
### Logs & Screenshots
`MilvusException: <MilvusException: (code=65535, message=invalid max query result window, (offset+limit) should be in range [1, 16384], but got 32 768)>`
### Additional Information
I edited milvus.py to use collection.query_iterator() instead of client.query()
Add in milvus.py :
`from pymilvus import connections, Collection`
And change query to :
```
def query(self, collection_name: str, filter: dict, limit: Optional[int] = None):
connections.connect(uri=MILVUS_URI,token=MILVUS_TOKEN,db_name=MILVUS_DB)
if limit is None:
limit = ( 16384 * 10 )
collection_name = collection_name.replace("-", "_")
if not self.has_collection(collection_name):
log.warning(
f"Query attempted on non-existent collection: {self.collection_prefix}_{collection_name}"
)
return None
filter_string = " && ".join(
[
f'metadata["{key}"] == {json.dumps(value)}'
for key, value in filter.items()
]
)
collection=Collection(name=f"{self.collection_prefix}_{collection_name}")
collection.load()
all_results = []
try:
log.info(
f"Querying collection {self.collection_prefix}_{collection_name} with filter: '{filter_string}', limit: {limit}"
)
# Use query_iterator to efficiently handle potentially large result sets
iterator = collection.query_iterator(
filter=filter_string,
output_fields=[
"id",
"data",
"metadata",
],
limit=limit, # Pass the limit directly; None means no limit.
)
# The iterator yields results in batches
results = []
while True:
result = iterator.next()
if not result:
iterator.close()
break
all_results += result
log.info(f"Total results from query: {len(all_results)}")
return self._result_to_get_result([all_results])
except Exception as e:
log.exception(
f"Error querying collection {self.collection_prefix}_{collection_name} with filter '{filter_string}' and limit {limit}: {e}"
)
return None
```
Now iteration works and we get the expected top k result
GiteaMirror
added the bug label 2026-04-25 07:18:07 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @julien-oss on GitHub (Aug 6, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16324
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.6.18
Ollama Version (if applicable)
No response
Operating System
Ubuntu 24.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When querying more than 16384 entries, milvus.py should iterate queries and return top k entries
Actual Behavior
After the first iteration, offset is equal 16384 and limit 16384, resulting in error
MilvusException: <MilvusException: (code=65535, message=invalid max query result window, (offset+limit) should be in range [1, 16384], but got 32 768)>Steps to Reproduce
Have a collection > 16384 in milvus
RAG query on this collection
Logs & Screenshots
MilvusException: <MilvusException: (code=65535, message=invalid max query result window, (offset+limit) should be in range [1, 16384], but got 32 768)>Additional Information
I edited milvus.py to use collection.query_iterator() instead of client.query()
Add in milvus.py :
from pymilvus import connections, CollectionAnd change query to :
Now iteration works and we get the expected top k result
@tjbck commented on GitHub (Aug 6, 2025):
PR welcome!
@rgaricano commented on GitHub (Aug 8, 2025):
for reference:
https://github.com/milvus-io/milvus/issues/36895
https://milvus.io/docs/with-iterators.md
@tjbck commented on GitHub (Aug 13, 2025):
Addressed with ad98d4300b5e0dec0beb4db157873efde8577e1a!