Wrote both things (query only, or all parameters) into a LinqPad script for easier, complete reference:
void Main()
{
//Reset from scratch since doesn't play great with linqpad
Startup.InitContainer();
//Setup the container contents
Startup.Init<FakeModel>("http://localhost:8983/solr");
var 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 opts = new QueryOptions
{
Start = 20,
Rows = 15,
OrderBy = new[] { new SolrNet.SortOrder("myFakeField") }
};
DumpQuery(q);
DumpAllParameters(q, opts);
}
private void DumpQuery(ISolrQuery q)
{
var serializer = ServiceLocator.Current.GetInstance<ISolrQuerySerializer>();
var queryRaw = serializer.Serialize(q);
//Dump is a LinqpadMethod, running elsewhere this needs to be modified
queryRaw.Dump("Query only");
}
private void DumpAllParameters(ISolrQuery q, QueryOptions opts)
{
var queryExecuterInterface = ServiceLocator.Current.GetInstance<ISolrQueryExecuter<FakeModel>>();
var queryExecuter = queryExecuterInterface as SolrQueryExecuter<FakeModel>;
queryExecuter.GetAllParameters(q, opts).Dump("All Parameters");
}
public class FakeModel
{
}