public async Task <SolrQueryResults <T> > ExecuteAsync(ISolrQuery q, QueryOptions options, CancellationToken cancellationToken = default(CancellationToken)) { var handler = options?.RequestHandler?.HandlerUrl ?? DefaultHandler; var param = GetAllParameters(q, options); var results = new SolrQueryResults <T>(); XDocument xml; if (connection is IStreamSolrConnection cc) { using (var r = await cc.GetAsStreamAsync(handler, param, cancellationToken)) { xml = XDocument.Load(r); } } else { var r = await connection.GetAsync(handler, param, cancellationToken); xml = XDocument.Parse(r); } resultParser.Parse(xml, results); return(results); }
/// <inheritdoc /> public async Task <SolrSchema> GetSchemaAsync(string schemaFileName) { string schemaXml = await connection.GetAsync("/admin/file", new[] { new KeyValuePair <string, string>("file", schemaFileName) }); var schema = XDocument.Parse(schemaXml); return(schemaParser.Parse(schema)); }
public async Task <SolrQueryResults <T> > ExecuteAsync(ISolrQuery q, QueryOptions options) { var param = GetAllParameters(q, options); var results = new SolrQueryResults <T>(); var r = await connection.GetAsync(Handler, param); var xml = XDocument.Parse(r); resultParser.Parse(xml, results); return(results); }
public virtual async Task <string> GetAsync(string relativeUrl, IEnumerable <KeyValuePair <string, string> > parameters, CancellationToken cancellationToken = default(CancellationToken)) { Console.WriteLine("Getting Async"); var r = await conn.GetAsync(relativeUrl, parameters, cancellationToken); Console.WriteLine("Result is:\n" + r); return(r); }
public async Task <string> GetAsync(string relativeUrl, IEnumerable <KeyValuePair <string, string> > parameters, CancellationToken cancellationToken = new CancellationToken()) { Log( $"{nameof(relativeUrl)}={relativeUrl}, " + $"{nameof(parameters)}={string.Join(", ", parameters.Select(p => $"{p.Key}={p.Value}"))}" ); return(await _connection.GetAsync(relativeUrl, parameters, cancellationToken)); }
public Task <string> ExecuteAsync(ISolrConnection connection) { return(connection.GetAsync("/admin/ping", new Dictionary <string, string>())); }
public Task <string> GetAsync(string relativeUrl, IEnumerable <KeyValuePair <string, string> > parameters) { var stringParams = string.Join(", ", parameters.Select(p => string.Format("{0}={1}", p.Key, p.Value)).ToArray()); return(connection.GetAsync(relativeUrl, parameters)); }
public Task <string> ExecuteAsync(ISolrConnection connection) { return(connection.GetAsync("/replication", Parameters.ToArray())); }
public Task <string> ExecuteAsync(ISolrConnection connection) { return(connection.GetAsync("/admin/cores", Parameters.ToArray())); }