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.
This commit is contained in:
Matt Westcott 2017-11-15 00:12:52 +00:00 committed by Karl Hobley
parent 4baa6cda58
commit 3ed72d3c0b

View file

@ -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