0

While using django full text search can we use SearchHeadline for mutiple field as of now if only takes one field to annotate headline.

search_vector = SearchVector('title', 'body')
search_query = SearchQuery(search_post)
search_headline = SearchHeadline('body', search_query)
questions = posts.annotate(search=search_vector, rank=SearchRank(search_vector, search_query)).annotate(headline=search_headline).filter(rank__gt=0.0001).order_by('-rank')

I use {{ post.headline|safe}}to view this in my django template.

Is there any way i can use another SearchHeadline where i can headline 'title' field which is used in search vector.

I tried annotate more than 2 times it over rides the previous headline.

Is there any solution which can be implemented?

saibhaskar
  • 435
  • 6
  • 21

0 Answers0