From 8a4edb45e71843b16e5bdb8fe6f1752e5c76b1c0 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Fri, 29 Jan 2021 09:08:03 -0500 Subject: [PATCH] also search url, timestamp, tags on public index --- archivebox/core/views.py | 3 ++- archivebox/themes/default/core/snapshot_list.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/archivebox/core/views.py b/archivebox/core/views.py index b46e364e..810b4740 100644 --- a/archivebox/core/views.py +++ b/archivebox/core/views.py @@ -9,6 +9,7 @@ from django.http import HttpResponse from django.views import View, static from django.views.generic.list import ListView from django.views.generic import FormView +from django.db.models import Q from django.contrib.auth.mixins import UserPassesTestMixin from core.models import Snapshot @@ -107,7 +108,7 @@ class PublicArchiveView(ListView): qs = super().get_queryset(**kwargs) query = self.request.GET.get('q') if query: - qs = qs.filter(title__icontains=query) + qs = qs.filter(Q(title__icontains=query) | Q(url__icontains=query) | Q(timestamp__icontains=query) | Q(tags__name__icontains=query)) for snapshot in qs: snapshot.icons = snapshot_icons(snapshot) return qs diff --git a/archivebox/themes/default/core/snapshot_list.html b/archivebox/themes/default/core/snapshot_list.html index 84abee7d..dd8ebf15 100644 --- a/archivebox/themes/default/core/snapshot_list.html +++ b/archivebox/themes/default/core/snapshot_list.html @@ -6,7 +6,7 @@