Apply pagination using sunburnt highlighted search

I am using Sunburnt Python Api For Solr Search

I am using highlighted search in Sunburnt it works fine

I am using the following code

search_record = solrconn.query(search_text).highlight("content").highlight("title")
records = search_record.execute().highlighting

Problem is it returns only 10 records. I know it can be change from solr-config.xml but issue is i want all records

I want to apply pagination using highlighted search of sunburnt

can any one help me ....

Answers


Given the SOLR-534 issue, which is still unresolved, you can't tell Solr to give you all results, but you can use a really high rows parameter depending on how many documents you expect to have in your index. I don't know anything about sunburnt but I believe something like this should work:

search_record = solrconn.query(search_text).paginate(rows=10000).highlight("content").highlight("title")

You just have to replace the rows value with something enough big depending on your index size.


The general approach to this is to use a paginator:

from django.core.paginator import Paginator

paginator = Paginator(si.query("black"), 30)

Once that's done, you can just paginate through everything:

for result in paginator.object_list:
    print result

Need Your Help

Best way to consume http resource from EJB or Java EE webapp

java java-ee httpclient ejb-3.0

I have a java ee 7 app with jsf2, ejb3.1 , jpa etc. running in a Glassfish4 container.

Scala slick: build query conditionally

scala slick

I am new to Scala and I am using Slick 3.1 and have this query: