Finding out which field matched in the search

14 views
Skip to first unread message

Eamonn Faherty

unread,
Jan 23, 2012, 4:35:16 AM1/23/12
to django-haystack
Hey all,

Firstly, thanks for this great library! It has been a pleasure to use
so far!

I have a little question. I have a model

class Person(models.Model):
f_name = models.CharField(...)
s_name = models.CharField(...)
many others ....

p = Person('john', 'doe)

I have my search working but I would like to be able to get the name
of the fields that match so I can generate a template that shows
them. For example in my code above if I search for 'john' I would
like to be able to print all Person instances with that but I would
like to be able to say they matched due to the f_name attribute.

Is this possible within Haystack or is this something I have to do in
my template?
Reply all
Reply to author
Forward
0 new messages