How to get all results from solr query?

后端 未结 8 899
温柔的废话
温柔的废话 2021-01-01 10:36

I executed some query like \"Address:Jack*\". It show numFound = 5214 and display 100 documents in results page(I changed default display results f

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-01 11:18

    As the other answers pointed out, you can configure the rows to be max integer to yield back all the results for a query. I would recommend though to use Solr feature of pagination, and build a function that will return for you all the results using the cursorMark API. The gist of it is you set the cursorMark parameter to '*', you set the page size(rows parameter), and on each result you'll get a cursorMark for the next page, so you execute the same query only with the cursorMark given from the last result. This way you'll have more flexibility on how much of the results you want back, in a much more performant way.

提交回复
热议问题