We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the README with some instructions on how to use the Headline class and present matched excerpts from the result set....
Headline
https://github.com/damoti/django-tsvector-field/blob/master/tsvector_field/query.py#L5
from django.db.models.expressions import F from django.contrib.postgres.search import SearchRank, SearchQuery import tsvector_field query = SearchQuery(self.form['text'].value()) qs = ( qs.filter(text__search=query) .annotate( match_title=tsvector_field.Headline(F('text__title'), query), match_text=tsvector_field.Headline(F('text__text'), query) ) .annotate(rank=SearchRank(F('text__search'), query)) .order_by('-rank') )
The text was updated successfully, but these errors were encountered:
Many thanks for how to use Headline. I almost had it right but this ticket got it working for me.
Sorry, something went wrong.
No branches or pull requests
Update the README with some instructions on how to use the
Headline
class and present matched excerpts from the result set....https://github.com/damoti/django-tsvector-field/blob/master/tsvector_field/query.py#L5
The text was updated successfully, but these errors were encountered: