diff --git a/website/blog/models.py b/website/blog/models.py index 44e0ab0..f99d4e9 100644 --- a/website/blog/models.py +++ b/website/blog/models.py @@ -5,6 +5,7 @@ from django.utils import timezone from django.utils.functional import cached_property from modelcluster.fields import ParentalManyToManyField from wagtail.admin.panels import FieldPanel +from wagtail.search import index from wagtailautocomplete.edit_handlers import AutocompletePanel from website.common.models import BaseContentPage, BaseListingPage @@ -57,6 +58,10 @@ class BlogPostPage(BaseContentPage): AutocompletePanel("tags"), ] + search_fields = BaseContentPage.search_fields + [ + index.RelatedFields("tags", [index.SearchField("title", boost=1)]) + ] + @cached_property def tag_list_page_url(self) -> Optional[str]: return SingletonPageCache.get_url(BlogPostTagListPage)