Solrnet Paging - How to set Start and Rows parameters from .NET?
I am a certified .NET developer who is responsible for implementing Solr search through Solrnet. I'm close to having it where I need it, but far from seeing the performance my client needs.
Normally I wouldn't write, but I don't find much documentation. Can you suggest good Solrnet resources? Here's my problem:
How to limit the set of results (documents) to say 25? I have limited my data grid to 25 results per page, but it is still very slow when even 1000 results are returned. I assume this is because Solr actually returns all 1000 speeches, even though I'm only showing 25. Is that correct? It looks like my default settings are set to 10 in solrconfig, but it looks like Solrnet bi-pass is what gets it all.
I also need to set the Start and Rows parameters so that I can swap - that will increase the speed a lot, right?
I was able to figure out how to handle the Sort option by adding the following to my Solr.Query: a new QueryOptions (). AddOrder (new SolrNet.SortOrder ("Popularity", Order.DESC)
But I don't see anything like this to set the Rows or Start options.
Any help you could offer would be greatly appreciated. Thanks -
Justin
a source to share
QueryOptions has many properties, including Start and Rows. If not specified, SolrNet will by default fetch a large number of documents (possibly all of your documents). I did this because I thought it would be less awesome behavior for new users as it makes it look more like a database. However, this is likely to change in the next release to reflect the actual default as defined in Solr's configuration.
Here's an example using the Start and Rows properties:
solr.Query(yourQuery, new QueryOptions {
Rows = 10,
Start = 20,
});
Take a look at the sample app for more guidance.
a source to share