NetEvolve.HealthChecks.Apache.Solr
5.11.2
Prefix Reserved
dotnet add package NetEvolve.HealthChecks.Apache.Solr --version 5.11.2
NuGet\Install-Package NetEvolve.HealthChecks.Apache.Solr -Version 5.11.2
<PackageReference Include="NetEvolve.HealthChecks.Apache.Solr" Version="5.11.2" />
<PackageVersion Include="NetEvolve.HealthChecks.Apache.Solr" Version="5.11.2" />
<PackageReference Include="NetEvolve.HealthChecks.Apache.Solr" />
paket add NetEvolve.HealthChecks.Apache.Solr --version 5.11.2
#r "nuget: NetEvolve.HealthChecks.Apache.Solr, 5.11.2"
#:package NetEvolve.HealthChecks.Apache.Solr@5.11.2
#addin nuget:?package=NetEvolve.HealthChecks.Apache.Solr&version=5.11.2
#tool nuget:?package=NetEvolve.HealthChecks.Apache.Solr&version=5.11.2
NetEvolve.HealthChecks.Apache.Solr
This package provides a health check for Apache Solr, based on the SolrNet.Core package. The main purpose is to check that the Solr server is reachable. The health check uses the Solr admin ping endpoint and does not require a core/collection name.
💡 This package targets .NET 8.0 and later.
Installation
To use this package, you need to add the package to your project. You can do this by using the NuGet package manager or by using the dotnet CLI.
dotnet add package NetEvolve.HealthChecks.Apache.Solr
Health Check - Apache Solr Liveness
This health check verifies Solr reachability via the admin ping endpoint.
- If the server responds slower than the configured timeout, the result is
Degraded. - If the server is not reachable or returns an error, the result is
Unhealthy.
Usage
After adding the package, you need to import the namespace NetEvolve.HealthChecks.Apache.Solr and add the health check to the service collection.
using NetEvolve.HealthChecks.Apache.Solr;
You can register the health check via configuration or code. In both approaches you must provide a unique name.
Parameters
name: Unique health check name used to match configuration.options: Optional configuration when using the builder approach. Supported options:BaseUrl(string),Timeout(milliseconds), andCreationMode(CreateorServiceProvider).tags: Optional tags appended to the defaults. The tagssolr,apache, andsearchare always included.
Variant 1: Configuration based
Add a configuration section under HealthChecks:Solr in appsettings.json, then register by name.
var builder = services.AddHealthChecks();
builder.AddSolr("<name>");
Example appsettings.json:
{
"HealthChecks": {
"Solr": {
"my-solr": {
"BaseUrl": "http://localhost:8983",
"Timeout": 100,
"CreationMode": "Create" // or "ServiceProvider" when Solr client is registered in DI
}
}
}
}
Variant 2: Builder based
Use this approach when values are dynamic or you have a single instance.
var builder = services.AddHealthChecks();
builder.AddSolr("my-solr", options =>
{
options.BaseUrl = "http://localhost:8983";
options.Timeout = 100; // milliseconds
options.CreationMode = ClientCreationMode.Create; // default: ServiceProvider
});
Example Program.cs registration and endpoint exposure:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHealthChecks()
.AddSolr("my-solr");
var app = builder.Build();
app.MapHealthChecks("/health");
app.Run();
When using CreationMode = ServiceProvider, ensure an ISolrBasicReadOnlyOperations<string> client is registered in DI before adding the health check.
Tags
You can provide additional tags to group or filter health checks.
var builder = services.AddHealthChecks();
builder.AddSolr("my-solr", options => { /* ... */ }, "critical", "liveness");
License
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- NetEvolve.Extensions.Tasks (>= 2.0.75)
- Newtonsoft.Json (>= 13.0.4)
- SolrNet.Core (>= 1.2.1)
-
net8.0
- NetEvolve.Extensions.Tasks (>= 2.0.75)
- Newtonsoft.Json (>= 13.0.4)
- SolrNet.Core (>= 1.2.1)
-
net9.0
- NetEvolve.Extensions.Tasks (>= 2.0.75)
- Newtonsoft.Json (>= 13.0.4)
- SolrNet.Core (>= 1.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.