Skip to content

Commit 3b386c0

Browse files
committed
clarify in the docs that execute should not be called when paginating with django paginator
1 parent ef88458 commit 3b386c0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/queryingsolr.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,16 @@ anywhere else you want to paginate contents) exactly as described in
268268
the `paginator example in the Django documentation
269269
<https://docs.djangoproject.com/en/1.3/topics/pagination/#using-paginator-in-a-view>`_.
270270

271+
.. Note::
272+
273+
When using a sunburnt query object with a Django paginator, you can
274+
chain any number of filters or any of the other methods that return
275+
a :class:`~sunburnt.SolrSearch` instance; however, you should *not*
276+
call :meth:`~sunburnt.SolrSearch.execute`, as that will execute the
277+
query and return the result set for the current query; to function
278+
properly, the paginator needs to be able to query Solr for the total
279+
number of matches for the query and then add pagination options to
280+
slice up the results appropriately.
271281

272282
Returning different fields
273283
--------------------------

0 commit comments

Comments
 (0)