Skip to main content
9 events
when toggle format what by license comment
S Jan 23, 2021 at 16:07 history suggested E. A. CC BY-SA 4.0
I removed import statements that were not used in the migrations file. The author most likely copied an existing migration file that had needed those imports and replaced the contents without discarding unused import statements.
Jan 22, 2021 at 22:52 review Suggested edits
S Jan 23, 2021 at 16:07
Jan 7, 2019 at 19:36 comment added roOt I have used something similar where I combined rank and similarity like this: score=(F("rank") + F("similarity")) / 2
S Nov 21, 2018 at 5:39 history suggested wengole CC BY-SA 4.0
I'm not 100% sure, but shouldn't `search` be `search_query` in the `similarity` annotation?
Nov 20, 2018 at 14:48 review Suggested edits
S Nov 21, 2018 at 5:39
Sep 27, 2018 at 12:26 comment added Thomas Frössman you could also sort by the greatest of both rank/score values if they are comparable for your use case: ``` return queryset.annotate(rank=SearchRank(vector, search_query) similarity=TrigramSimilarity( 'name', search ) + TrigramSimilarity( 'content', search ), best_score=Greatest('rank', 'similarity') ).filter(Q(best_score__gte=0.3)).order_by('-best_score')[:20] ```
May 8, 2017 at 9:11 comment added Private Thanks for sharing the solution you found.
Jul 11, 2016 at 15:07 vote accept SalahAdDin
Jun 18, 2016 at 4:52 history answered SalahAdDin CC BY-SA 3.0