/// <summary> /// Parses a chunk of a query response into the results object /// </summary> /// <param name="xml">query response</param> /// <param name="results">results object</param> public void Parse(XDocument xml, CrownPeakQueryResults <T> results) { // Call out to the base to do the initial parse of the results Parse(xml, results as AbstractSolrQueryResults <T>); // Get our logging id out of the results var responseElement = xml.Element("response"); if (responseElement != null) { var lstElement = responseElement.Elements("lst").LastOrDefault(); if (lstElement != null) { var strElement = lstElement.Element("str"); if (strElement != null) { if (results.CrownPeak == null) { results.CrownPeak = new CrownPeakResults(new CrownPeakLoggingResults()); } if (results.CrownPeak.Logging == null) { results.CrownPeak.Logging = new CrownPeakLoggingResults(); } results.CrownPeak.Logging.Id = strElement.Value; } } } }
/// <summary> /// Executes the query and returns results /// </summary> /// <returns>query results</returns> public new CrownPeakQueryResults <T> Execute(ISolrQuery q, SolrNet.Commands.Parameters.QueryOptions options) { var param = GetAllParameters(q, options); var results = new CrownPeakQueryResults <T>(); var r = _connection.Get(Handler, param); var xml = XDocument.Parse(r); _parser.Parse(xml, results); return(results); }