Get started with the Solr integration

Este conteúdo não está disponível em sua língua ainda.

⭐ Community Toolkit

Apache Solr is a search platform built on Apache Lucene. The Aspire Community Toolkit hosting integration runs a Solr container, creates a core, and supplies the core’s HTTP URL to apps that reference it.

  • Start a local search service with a core configured by the AppHost.
  • Use a custom configset to define the core’s schema and search behavior.
  • Persist indexes and configuration with a volume or bind mount.
  • Check the core’s ping endpoint before starting dependent apps.

Install 📦 CommunityToolkit.Aspire.Hosting.Solr in the AppHost. Each resource runs a Solr container with one core selected at creation. A reference passes the core URL, host, port, and core name to the consuming app.

flowchart LR
    AppHost[AppHost hosting integration] --> Solr[Solr container and core]
    AppHost -->|Core URL| App[Consuming app]
    App -->|HTTP queries and updates| Solr
  • Complete the Aspire prerequisites.
  • Start a supported container runtime.
  • Create an AppHost and a consuming app. The .NET walkthrough uses an ASP.NET Core project named Api, referenced by the AppHost.
  • Prepare a valid Solr configset directory if the app needs a custom schema.
  1. Install the hosting package and add a resource named solr. Select a core name, then reference the resource from the consuming app and wait for it. See Solr hosting integration for runnable AppHost examples.

  2. Read ConnectionStrings:solr in .NET, or ConnectionStrings__solr in other languages. The value already includes /solr/{coreName}. See Connect with the Solr integration for complete HTTP examples.

  3. Run aspire run. Open the Solr HTTP endpoint from the dashboard to inspect the administration UI, then query the core from the consuming app.