Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When querying Solr using SolrNet, what is the easiest way to see the actual Url that gets requested?

I'm trying to debug a application that is using SolrNet to query Solr. I'm trying to figure out what url that actually gets requested from SolrNet so that I can debug it more easilly in a web browser.

like image 415
Mikael Engver Avatar asked Jan 11 '23 06:01

Mikael Engver


2 Answers

There is a question on the SolrNet Google Group - Get Raw Solr Query that provides a couple of ways to get this output.

like image 130
Paige Cook Avatar answered Jan 13 '23 18:01

Paige Cook


Just to save you the effort of heading out to the forum :

var serializer = ServiceLocator.Current.GetInstance<ISolrQuerySerializer>(); 
queries = new List<ISolrQuery>
{
new SolrQueryByField("category_facet", "Fjärrin"),
new SolrQueryByField("branch_facet", sigel),
new SolrQueryByField("isArchived", "false"),
SolrQuery.All
};
var q = new SolrMultipleCriteriaQuery(queries,"AND");
var queryRaw = serializer.Serialize(q);
Debug.WriteLine(queryRaw);
like image 45
Fontanka16 Avatar answered Jan 13 '23 18:01

Fontanka16