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!