0

I'm using the built-in Wagtail search with POSTGRES backend. I don't want to go to Elastic Search as this would be overkill for the site concerned.

The problem I'm hitting and can't find any info on is how to perform a site-wide search that includes all the search fields declared in the subclassed pages.

For example:

class SEOPage(Page):
....
    search_fields = Page.search_fields + [
        index.SearchField('summary'),
    ]

class BlogDetailPage(SEOPage):
....
    search_fields = SEOPage.search_fields + [
        index.SearchField('body'),
    ]

But if do something like

Page.objects.search("findme")

or even

Page.objects.specific().search("findme")

then neither the summary or body fields are searched because they don't exist at the Page model level.

Is there any way to perform a site wide search that includes all the SearchField's in the site?

1 Answers1

0

Thanks to Matt Westcott, the solution was to use the POSTGRES backend: https://docs.wagtail.io/en/latest/reference/contrib/postgres_search.html

It's very easy to add multi-language support using this as well.