From 3ed72d3c0b1aca7176910bbbe703a0c82306d3ef Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Wed, 15 Nov 2017 00:12:52 +0000 Subject: [PATCH] Ensure we only look at SearchField records (not FilterField) to find boost values It's valid for the same field to exist as both a SearchField and FilterField, and in this case get_boost would randomly find the FilterField and try (and fail) to read its 'boost' attribute. --- wagtail/contrib/postgres_search/backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail/contrib/postgres_search/backend.py b/wagtail/contrib/postgres_search/backend.py index 8d3a72c80..559eef97f 100644 --- a/wagtail/contrib/postgres_search/backend.py +++ b/wagtail/contrib/postgres_search/backend.py @@ -180,7 +180,7 @@ class PostgresSearchQuery(BaseSearchQuery): def __init__(self, *args, **kwargs): super(PostgresSearchQuery, self).__init__(*args, **kwargs) - self.search_fields = self.queryset.model.get_search_fields() + self.search_fields = self.queryset.model.get_searchable_search_fields() def get_search_query(self, config): combine = OR if self.operator == 'or' else AND