public void QueryByExample() { var query = new Dictionary <string, string> { { "q", "(Id:123456)" }, { "rows", DefaultRows() }, }; var conn = new MockConnection(query); Solr.Connection = conn; var doc = new TestDocumentWithId { Id = 123456 }; Solr.Query <TestDocumentWithId>().By("Id").Is("123456").Run(); }
public void OrderBy() { var conn = new MockConnection(new Dictionary <string, string> { { "q", "(Id:123456)" }, { "sort", "id asc" }, { "rows", DefaultRows() }, }); Solr.Connection = conn; var doc = new TestDocumentWithId { Id = 123456 }; Solr.Query <TestDocumentWithId>() .By("Id").Is("123456") .OrderBy("id") .Run(); }
public void OrderByAscDescMultiple() { var query = new Dictionary <string, string> { { "q", "(Id:(123456))" }, { "rows", DefaultRows() }, { "sort", "id asc,name desc" }, }; var conn = new MockConnection(query); Solr.Connection = conn; var doc = new TestDocumentWithId { Id = 123456 }; Solr.Query <TestDocumentWithId>() .By("Id").Is("123456") .OrderBy("id", Order.ASC) .OrderBy("name", Order.DESC) .Run(); }
public void OrderByAscDescMultiple() { var query = new Dictionary<string, string> { {"q", "((Id:123456))"}, {"rows", DefaultRows()}, {"sort", "id asc,name desc"}, }; var conn = new MockConnection(query); Solr.Connection = conn; var doc = new TestDocumentWithId {Id = 123456}; Solr.Query<TestDocumentWithId>() .By("Id").Is("123456") .OrderBy("id", Order.ASC) .OrderBy("name", Order.DESC) .Run(); }
public void QueryByExample() { var query = new Dictionary<string, string> { {"q", "(Id:123456)"}, {"rows", DefaultRows()}, }; var conn = new MockConnection(query); Solr.Connection = conn; var doc = new TestDocumentWithId {Id = 123456}; Solr.Query<TestDocumentWithId>().By("Id").Is("123456").Run(); }
public void OrderBy() { var conn = new MockConnection(new Dictionary<string, string> { {"q", "(Id:123456)"}, {"sort", "id asc"}, {"rows", DefaultRows()}, }); Solr.Connection = conn; var doc = new TestDocumentWithId {Id = 123456}; Solr.Query<TestDocumentWithId>() .By("Id").Is("123456") .OrderBy("id") .Run(); }