I have a userprofile search index, like so:
class UserProfileIndex(SearchIndex, Indexable):
text = CharField(document=True, use_template=True)
last_name = CharField(model_attr='last_name', indexed=True)
country = CharField(model_attr='country')
sectors = CharField(use_template=True)
services = CharField(use_template=True)
def get_model(self):
return UserProfile
def index_queryset(self, using=None):
"""
Used when the entire index for model is updated."""
return self.get_model().public.all()
and I am trying to sort by the last_name field using this command:
s = SearchQuerySet().all().order_by('last_name')
I then get back:
Exception: No column for field 'last_name'
I have no problems doing a filter on that field.
s = SearchQuerySet().filter(last_name='Smith')
works fine.
I'm guessing this is a Whoosh issue, but I can't seem to find a work around.