You should look for elasticsearch

On Sun, 15 Mar 2020, 9:08 am Will Meyers, <williamgmey...@gmail.com> wrote:

> Hi all,
>
> Just a quick question. I'm working on a general search function for my
> application and just wanted your opinions before I do any sort of
> benchmarking.
>
> Right now I have a PostgreSQL database with a table (model) which includes
> a title column and summary column (both charfields).
>
> Would it be more efficient to call:
>
> v = SearchVector(title, weight='A') + SearchVector(summary, weight='A')
> results = MyModel.objects.annotate(rank=SearchRank(v, 'my
> query')).filter(rank__gte=0.5)
>
> Or should I join the title and summary (i.e. create a new column
> title_summary within the model which just concats them) and do the search
> on that with:
>
> v = SearchVector(title_summary, weight='A')
> results = MyModel.objects.annotate(rank=SearchRank(v, 'my
> query')).filter(rank__gte=0.5)
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7c884279-de2e-42ad-a18b-2f2e49315954%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7c884279-de2e-42ad-a18b-2f2e49315954%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPjsHcEyytUTOe1W1dKs%2B2J%3DwahFaQSQKQiQ1Pg5sOF5qSbrJA%40mail.gmail.com.

Reply via email to