X-Git-Url: https://git.0d.be/?p=chloro.git;a=blobdiff_plain;f=chloro%2Fphyll%2Fviews.py;fp=chloro%2Fphyll%2Fviews.py;h=86f6f09533a0e58871d769d1e3b4ad81ea1c5ea4;hp=8472c510ad6ddfe06e1faf2ad074be8e3e2fe582;hb=633d539a30a75e5d7cb2fa84ead0c6cec617f5e5;hpb=4fa69d96dca6d143c5f8ad7522556aa0cc740abc diff --git a/chloro/phyll/views.py b/chloro/phyll/views.py index 8472c51..86f6f09 100644 --- a/chloro/phyll/views.py +++ b/chloro/phyll/views.py @@ -191,7 +191,9 @@ def ajax_new_page(request, *args, **kwargs): def ajax_search(request, *args, **kwargs): - vector = SearchVector('title', weight='A') + SearchVector('plain_text', weight='B') + vector = SearchVector('title', weight='A', config='french') + SearchVector( + 'plain_text', weight='B', config='french' + ) query = SearchQuery(request.GET.get('q', ''), config='french') results = ( Note.objects.annotate(rank=SearchRank(vector, query)).filter(rank__gte=0.1).order_by('-rank')[:10]