You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2026/06/24 21:11:38 UTC
(allura) 01/02: don't pass sort=None etc to solr
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch db/solr_nones
in repository https://gitbox.apache.org/repos/asf/allura.git
commit e0acd3bab7c31a1d495511ab6a2f2a74a4554fd2
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Wed Jun 24 17:11:21 2026 -0400
don't pass sort=None etc to solr
---
Allura/allura/lib/search.py | 4 ++++
Allura/allura/lib/solr.py | 3 +++
2 files changed, 7 insertions(+)
diff --git a/Allura/allura/lib/search.py b/Allura/allura/lib/search.py
index b234a863b..701330b01 100644
--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -181,6 +181,10 @@ def search(q, short_timeout=False, ignore_errors=True, search_fn=None, **kw):
search_fn = g.solr_short_timeout.search
else:
search_fn = g.solr.search
+
+ # don't pass through sort=None etc
+ kw = {k: v for k, v in kw.items() if v is not None}
+
try:
# try once with opportunity to retry
try:
diff --git a/Allura/allura/lib/solr.py b/Allura/allura/lib/solr.py
index 68fddb3c6..b8f270a59 100644
--- a/Allura/allura/lib/solr.py
+++ b/Allura/allura/lib/solr.py
@@ -176,6 +176,9 @@ def commit(self):
pass
def search(self, q, fq=None, **kw):
+ for k, v in kw.items():
+ if v is None:
+ raise ValueError(f'{k}={v} passed to solr search')
if q is None:
q = '' # shlex will hang on None
# Parse query