How to get all results from solr query?

后端 未结 8 841
温柔的废话
温柔的废话 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:28

    For selecting all documents in dismax/edismax via Solarium php client, the normal query syntax : does not work. To select all documents set the default query value in solarium query to empty string. This is required as the default query in Solarium is :. Also set the alternative query to :. Dismax/eDismax normal query syntax does not support :, but the alternative query syntax does.

    For more details following book can be referred

    http://www.packtpub.com/apache-solr-php-integration/book

    0 讨论(0)
  • 2021-01-01 11:29

    I remember myself doing &rows=2147483647

    2,147,483,647 is integer's maximum value. I recall using a number bigger than that once and having a NumberFormatException because it couldn't be parsed into an int. I don't know if they use Long nowadays, but 2 billion rows is normally more than enough.

    Small note:
    Be careful if you are planning to do this in production. If you do a query like * : * and your index is big, you could transferring a couple of gigabytes in that query.
    If you know you won't have many docs, go ahead and use integer's max value.

    On the other hand, if you are doing a one-time script and just need to dump all results (for example document ID's) then this approach is valid, if you don't mind waiting 3-5 minutes for a query to return.

    0 讨论(0)
提交回复
热议问题