Pagination in Django Haystack

199 views
Skip to first unread message

mmuk2

unread,
Aug 2, 2013, 2:13:24 AM8/2/13
to django-...@googlegroups.com
Hi,

I'm new do haystack, so this might sound like a newbie question.

I've followed the instructions on the official Haystack site and have it all working, and my search.html template looks exactly like the search template on the site:


In urls.py, I have the following entry:

(r'^search/', include('haystack.urls')),

I have also set up my indexes and have re_indexed, and all seems to be good.

The problem I have is that my search results all appear on one page, and the pagination code in search.html gets ignored because the page.has_next and page.has_previous values are always false.

So it looks like I have no idea how to set the pagination value, ie. how many records are displayed per page.

Do I need to create a custom view in order to implement pagination, or is there some built in Haystack functionality that I can use?

If someone could kindly point me in the right direction, that would be greatly appreciated.

Mark

Joey Wilhelm

unread,
Aug 2, 2013, 12:52:52 PM8/2/13
to django-...@googlegroups.com
Hi Mark,

Have you set HAYSTACK_SEARCH_RESULTS_PER_PAGE in your project's settings.py? Try setting it to some low value, like 1 or 2, and that should let you know whether it's working.

-Joey


--
You received this message because you are subscribed to the Google Groups "django-haystack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-haysta...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

mmuk2

unread,
Aug 13, 2013, 2:52:40 AM8/13/13
to django-...@googlegroups.com
Thanks Joey, looks like that was it!
Reply all
Reply to author
Forward
0 new messages