django-query

More strict query yields more results?

I've got a query that looks like this affiliates = User.objects.annotate(referral_count=Count('referrals')) .filter(referral_count__gt=0) But when I restrict it more by adding referrals__user__date_joined__gt=start_date to the filter, I get even higher referral counts. I'm trying to count the number of people...

Django full text search order by relevance

I am using the Django query filter __search to perform a full text search e.g MyModel.objects.filter(title__search = 'some title') How do I get it to order by relevance, as currently it seems to be ordering alphabetically? Specifically I would like search results where the title was some title to appear first before something that ha...