Hi Mauricio,
thanks for your answer :)
I agree with most of your points, but the needs are quite special.
In this case, our function is just to provide the backend for the caller's services. So, if they somehow decide to hack our functionality, this will be directly affecting to their performance, so that this is definitely not interesting for the caller.
In adition to that, this concrete client is much more expert in Solr issues than us, so the problem of knowing Solr's APIs disappears.
In conclusion, as they are the guys who manage the presentation layer (in this case a web application), they wanted to take control on rows, start, faceting, ..., but we didn't want to request that parameters one by one, in order not to modify our APIs in the future, just in case more new params were needed.
Finally, if this is worthy for someone else, I've implemented the next solution, based on your own approach (It would be really worthy for me to listen to your opinions about it):
http://bugsquash.blogspot.com.es/2010/12/customizing-solrnet.html1) Creating a
CustomSolrConnection class which overrides the 'Get' function from the ISolrConnectionClass.
2) Calculating the 'q' param, the 'fq' params (if needed), and the rest of params (string parameter from my client e.g. [...&fl=docId&start=20&rows=10...])
3) Compose the final querystring (q=...fq=...[rest of params])
4) Send this final querystring to the
CustomSolrConnection Class
5) Calling the
Get method of
CustomSolrConnection class, which does not take the parameters from the
IEnumerable<KeyValuePair<string, string>> parameters. Instead of that, takes the final querystring previously received.
6) Returning directly the
Solr response as string, which was one of my client needs.
And that's it. Moreover, we keep offering the other API function, which uses 100% SolrNet to perform all the Solr queries and get results, so that my client can use both functions (same results) depending of their needs.
Thanks for your help :)
Kind regards,
Borja.