etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.2k stars 130 forks source link

Sort by rank and an additional criteria #175

Closed davegri closed 8 years ago

davegri commented 8 years ago

Is it possible to have a sort by additional criteria? I would like to first sort by rank and if rank is the same then sort by popularity (a field on my model)

etianen commented 8 years ago

If you're only searching one model, then use watson.filter(), which returns a queryset of your model. You can then .order_by("-watson_rank", "-popularity")