2024-05-16 15:08:15 发布
网友
Solrpy是python的solr客户机。基本用途是:
s = solr.SolrConnection('http://localhost:8080/solr/bt') rows = 20 results = s.query(q, rows=rows)
如何进行分页查询?你知道吗
您可以使用两个参数start和rows来控制分页。你知道吗
start
rows
示例start=0&;rows=20将给出前20个结果,start=20&;rows=20将给出下20组结果。你知道吗
更新
>>> response = c.query('test', rows=20) >>> print response.results.start 0 >>> for match in response: ... print match['id'], 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 >>> response = response.next_batch() >>> print response.results.start 20
您可以使用两个参数
start
和rows
来控制分页。你知道吗示例start=0&;rows=20将给出前20个结果,start=20&;rows=20将给出下20组结果。你知道吗
更新
相关问题 更多 >
编程相关推荐