mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00:00
dont prevent search when backend throws an exception or times out
This commit is contained in:
parent
9f05cf8283
commit
52429b8d15
2 changed files with 5 additions and 1 deletions
|
@ -15,6 +15,7 @@ class SearchResultsAdminMixin:
|
|||
qsearch = query_search_index(search_term)
|
||||
qs = qs | qsearch
|
||||
except Exception as err:
|
||||
print(f'[!] Error while using search backend: {err.__class__.__name__} {err}')
|
||||
messages.add_message(request, messages.WARNING, f'Error from the search backend, only showing results from default admin search fields - Error: {err}')
|
||||
|
||||
return qs, use_distinct
|
||||
|
|
|
@ -223,7 +223,10 @@ class PublicIndexView(ListView):
|
|||
query = self.request.GET.get('q')
|
||||
if query and query.strip():
|
||||
qs = qs.filter(Q(title__icontains=query) | Q(url__icontains=query) | Q(timestamp__icontains=query) | Q(tags__name__icontains=query))
|
||||
qs = qs | query_search_index(query)
|
||||
try:
|
||||
qs = qs | query_search_index(query)
|
||||
except Exception as err:
|
||||
print(f'[!] Error while using search backend: {err.__class__.__name__} {err}')
|
||||
return qs
|
||||
|
||||
def get(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue