I'm using Cassandra + Solr and the query is with "solr_query", always getting up to 10 results. This is the amount from:
<requestHandler class="solr.SearchHandler" default="true" name="search">
<lst name="defaults">
<int name="rows">10</int>
</lst>
</requestHandler>
I'm using eachRow to paginate the results and it's not working, it's get only the first 10 results and that's it.
var query = 'SELECT * FROM contacts WHERE solr_query = ?';
var solr_query = '{"q":"some_query"}';
this.client.eachRow(query, [solr_query], { prepare: true, autoPage : true, fetchSize: 100 }, function(index, result) {
}, callbackFunc);
In the fetchSize I've put 100 and still get only 10 results, if I'm adding LIMIT to the query it will work but still not paginate, it's stopped after the first page.
-- UPDTAE Also I have try to use this function and the same result (10):
this.client.stream(query, [solr_query], { prepare: true }).on('readable', function () {
var row;
while (row = this.read()) {
contacts.push(row);
}
})
.on('end', function () {
console.log(contacts.length); // 10
});
When using Search component, these are 2 different settings -
LIMITcontrols how many entries Cassandra will return, andfetchSizespecifies how big are pages that are returned by Cassandra. If you have many results, then you need to adjustLIMITaccordingly, although for big datasets it could be not very optimal.