class Note(models.Model):user = models.ForeignKey(User)pub_date = models.DateTimeField()title = models.CharField(max_length= 200)body = models.TextField()
--
You received this message because you are subscribed to the Google Groups "django-haystack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-haystack/-/U7HoSqryi0MJ.
To post to this group, send email to django-...@googlegroups.com.
To unsubscribe from this group, send email to django-haysta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-haystack?hl=en.
Hi Vignesh,To constrain your search to a specific field you'll need to do something like:`SearchQuerySet().filter(my_field='searchterm')`This should explain further: http://django-haystack.readthedocs.org/en/latest/searchqueryset_api.html#filter but it works very similar to how the Django ORM works.Good luck,DavidOn Wednesday, 25 April, 2012 at 1:42 AM, Vignesh Sarma wrote:
Hi,I have gone through the tutorial http://django-haystack.readthedocs.org/en/v1.2.7/tutorial.htmland my Model is like:class Note(models.Model):user = models.ForeignKey(User)pub_date = models.DateTimeField()title = models.CharField(max_length= 200)body = models.TextField()Now I want to change it so that I can search only in one of the fields like, search in title or user etc.I would be like gmail, advanced search option.where you can search with specific values in different fields.I am using solr as the backend.--
You received this message because you are subscribed to the Google Groups "django-haystack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-haystack/-/U7HoSqryi0MJ.
To post to this group, send email to django-haystack@googlegroups.com.
To unsubscribe from this group, send email to django-haystack+unsubscribe@googlegroups.com.