get raw solr query using toString() ?

2,129 views
Skip to first unread message

SeanR

unread,
Dec 6, 2012, 3:50:52 PM12/6/12
to sol...@googlegroups.com

Hi all,

I'm playing with the SolrNet sample app and wanted to get access to the raw solr http for debugging and learning.

In the controller we have

 public ISolrQuery BuildQuery(SearchParameters parameters) {
            if (!string.IsNullOrEmpty(parameters.FreeSearch))
                return new SolrQuery(parameters.FreeSearch);
            return SolrQuery.All;
        }

I spotted http://stackoverflow.com/questions/801847/getting-solrquery-full-query-string

so I figured BuildQuery(myparams).ToString() would do the trick but it returns the Type name.

Ideally i'd like access to the full solr query i.e. to include the paging, rows, sorting etc.

var matchingProductions = solr.Query(BuildQuery(parameters), new QueryOptions {});

but there doesn't seem to be anyway of combining the Query(ISolrQuery, QueryOptions) without actually executing the query - and the result doesn't have any properties that look like a raw query.

Thanks in advance

SeanR

Mauricio Scheffer

unread,
Dec 6, 2012, 7:53:37 PM12/6/12
to sol...@googlegroups.com
Hi Sean,

That Stackoverflow question was about Solrj, not SolrNet. 

See also LoggingConnection in the sample app.




--
Mauricio





SeanR

--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To view this discussion on the web visit https://groups.google.com/d/msg/solrnet/-/6wJzX_2F2sEJ.
To post to this group, send email to sol...@googlegroups.com.
To unsubscribe from this group, send email to solrnet+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/solrnet?hl=en.

SeanR

unread,
Dec 7, 2012, 5:56:46 PM12/7/12
to sol...@googlegroups.com
Thanks Mauricio,

I'll try those suggestions. As always, your work and support most appreciated. I'm really enjoying using SolrNet with Solr.

regards

SeanR
Reply all
Reply to author
Forward
0 new messages