Setting up Solr 9 for CKAN

Solr 9 is the recommended search engine for CKAN installs in the install docs, and CKAN 2.11 recommends its own schema. This page covers the version choices, setup sequence and rebuild decisions that determine whether your portal search still works after an install or upgrade.

On this page

Solr 9 for CKAN: what breaks when search is misconfigured

Search trouble on a CKAN portal often first appears as missing datasets, stale facets or search errors after an install or upgrade. Solr is the search index CKAN uses for dataset search, and Solr 9 is the recommended version for source installs, with Solr 8 also supported. CKAN 2.10.3 added Solr 9 support, so the first check is whether your CKAN patch level supports the Solr major version you run. The second check is the schema. CKAN 2.11 recommends its own schema, and the 2.10 schema still works, but a portal that upgraded CKAN and kept an older schema file is searching against field definitions the new release was not written for. Confirm both before you reindex anything.

Teams bring in outside help when the search setup has to be right in several places at once. Common triggers are several environments (development, staging and production) that must run the same Solr major version and schema, extensions or custom metadata schemas that add index fields the core schema does not define, and a change that needs rebuilding the index on a live portal. Each of these is easier to get right with a written scope before work starts. That scope should name the Solr versions per environment, the schema file and its source, every field an extension adds and who owns it, how the index is rebuilt and in what order, and how the team checks that search results match the dataset records afterward.

When search is misconfigured, the failures have distinct causes. Missing datasets usually mean the index does not hold records the database has, often after a schema or indexing change that was never followed by a rebuild. Stale facets point to a field that changed in the schema or an extension without the index being refreshed. Search errors usually come from a query that asks Solr for a field its schema.xml does not define, or from a Solr version the CKAN release does not support. Before you change anything, record which Solr version and schema each environment uses and compare them with the CKAN version in the same environment. That record tells you which of the three failures you are dealing with.

Choosing Solr 9 or Solr 8 for CKAN and which schema to load

This table compares the Solr versions, schema files and hosting choices a CKAN team can run for search, with one row per combination. Read each row against your CKAN version and your extensions, since the CKAN changelog says the 2.10 schema still works on CKAN 2.11 but the 2.11 schema is recommended. For most new CKAN 2.11 installs, Solr 9 with the 2.11 schema is the starting point, and the other rows describe transition or hosting choices.

OptionWhen it fitsWhat to confirm
Solr 9 with the 2.11 schemaRecommended for CKAN 2.11 installs, including new buildsSchema matches your CKAN minor version, and you know which extension fields it must include
Solr 9 with the 2.10 schema on CKAN 2.11Upgrades where the 2.11 schema is not ready yet, since the changelog says it still worksPlan the move to the 2.11 schema and a index rebuild, then test search with your extension fields
Solr 8 for existing installsSites already running Solr 8 that cannot move to Solr 9 in the same change windowConfirm your CKAN version still lists Solr 8 as an option, and schedule a tested move to Solr 9
Docker image tagged for your CKAN versionTeams using CKAN Docker images that want the Solr image kept in step with CKANImage tag matches your CKAN release, and you check the schema file shipped in the image
Self-managed Solr hostTeams with a standard Solr host or VM process that need custom Solr settingsYou copy the schema for your CKAN version into the core and own Solr patching and index rebuilds
Extensions that add Solr fieldsPortals with extensions that index custom metadata into searchCheck each extension's documentation for the schema it expects, and merge its fields into the schema you load

How CKAN, Solr and PostgreSQL exchange search data

The diagram starts with a search user whose request reaches the CKAN web app, which sends the query to the Solr core inside a trust boundary. Solr is reachable only from CKAN components, so the web app and background workers are the only senders. Background workers push dataset changes to Solr, while PostgreSQL stays the system of record: CKAN writes datasets there first, and the Solr index can be rebuilt from it. An operator triggers a rebuild through the workers after a schema change. Check that Solr accepts connections only from CKAN hosts, and that a rebuild is planned after every schema update.

Search requests and index updates flow into Solr, with PostgreSQL as the source of truth.

Setting up Solr 9 for CKAN in order

This sequence takes a CKAN portal from a Solr install that is not yet connected to a search index that matches the CKAN version, is reachable only from CKAN hosts, and respects dataset visibility. Each step ends with a check you can record, so a failed step is caught before the next one starts.

  1. Confirm the CKAN and Solr versions

    Read the CKAN changelog and install documentation for the exact release you run, and record its minor version. CKAN 2.10.3 added Solr 9 support. The 2.10 schema still works on CKAN 2.11, but the 2.11 schema is recommended for that line. The person who owns the deployment confirms the Solr major version and the schema file name in writing before any server is built. Done when the CKAN and Solr version pair and the schema file name are written into the change record.

  2. Deploy Solr 9 with the matching schema

    Start Solr 9 from the CKAN Solr image tagged for your CKAN version, or from a release package, and load the schema.xml that matches that CKAN version. Create one core for CKAN and apply the schema to it. Use the schema file from the CKAN source for that release, not a copy from an older deployment. Done when the Solr admin interface reports the core as available and the schema on the server matches the file in the CKAN source for your release.

  3. Point CKAN at the Solr core

    Set the Solr URL in your CKAN configuration to the base address of the core, including the core name. Confirm the exact setting name in the documentation for your CKAN version before you edit the configuration file or the environment variable that holds it. Restart the CKAN web processes and background workers so they read the new value. Done when the expected URL appears in the running configuration and a search page loads without a Solr connection error in the logs.

  4. Restrict network access to Solr

    Allow connections to the Solr port only from the CKAN web servers, background workers and any indexing hosts. Block public access at the firewall and load balancer layers, and keep the Solr admin interface away from end users and the internet. Confirm the access list with your network team and record it. Done when a connection from an approved CKAN host succeeds, a connection from outside the approved list is refused, and both tests are recorded.

  5. Rebuild the search index

    Run the CKAN search index rebuild command, ckan search-index rebuild, from a host that can reach both CKAN and Solr, so every existing dataset is written into the new core under the current schema. Plan the window for the job based on your dataset count and hardware, and keep the full log output. Done when the command finishes without errors in the log and the number of indexed datasets matches the number of active datasets in the CKAN database.

  6. Verify keyword search and facets

    Choose a set of test datasets in advance, and record a term from each dataset's title and a term from its description. Run a keyword search for each term and confirm the dataset appears in the results. Then apply each facet, such as organization, tags and formats, and check that the counts match what the organization pages and the database show for the same datasets. Done when every test term returns its dataset and the facet counts agree with the database for the test set.

  7. Verify private dataset visibility by role

    Open a private browser session or log out, then run the same keyword searches and facet checks as an anonymous user. Private datasets must not appear in results, facet counts or direct dataset pages. Sign in as a sysadmin and confirm that the private test dataset appears in search with its private label. Done when the anonymous session shows only public test datasets, the sysadmin session shows the private dataset, and both results are recorded with the date and the CKAN version.

Matching the Solr schema to your CKAN version

CKAN 2.10 is the line where the exact patch matters most, because Solr 9 support arrived in CKAN 2.10.3. Earlier 2.10 patches predate that support, so a Solr 9 setup should not be assumed to work there. A mismatch between the schema and the CKAN code usually appears as search queries that error out or as fields that are missing from results, so confirm the patch before you choose anything else. The CKAN changelog records when each change landed.

  • Minimum patch: Run CKAN 2.10.3 or a later 2.10 patch before you use Solr 9 with this line.
  • Matching schema: Take the schema from the same release tag as your installed CKAN patch, and keep that copy under version control with your deployment.
  • Support window: Confirm the patch is still supported, since outdated patch releases lose support once a newer patch is out.
  • Image pin: Pin the Solr 9 image and the schema together so a rebuild cannot pull one without the other.

Check the installed patch on your running instance, then confirm that the schema file matches the same patch before the first index build.

When a schema change requires an index rebuild

Rebuild the Solr index when the schema that your CKAN version expects no longer matches the schema your Solr core runs. Four situations trigger this: you change the Solr schema file yourself, you move to a CKAN minor version that ships a different schema, you make a Solr major version move, or you restore a Solr core from a backup taken before the current schema was in place. CKAN patch releases exclude schema changes, so a patch upgrade is less likely to need a rebuild, but confirm this for each release in the CKAN changelog before you schedule the upgrade. If you move to CKAN 2.11, the 2.10 Solr schema still works, but the 2.11 schema is recommended, so switching schemas is a decision to take deliberately.

The rebuild is paid for in engineering and operations time. It is a one-time cost for each schema change, although schema changes recur with each minor upgrade. Rebuild time grows with the number of datasets in the portal and with the index fields that your extensions add, because each dataset is written back to the index with its full set of fields. Before you set a window, have your team time a rebuild on a staging copy that uses your actual dataset count and extension list. When a partner quotes the work, ask for the duration to be based on that measurement and on the number of extension index fields they must reconcile.

Search can be stale while the rebuild runs, so the team needs a planned window. Datasets created or edited during the run may not appear correctly in results until the rebuild finishes or those datasets are reindexed, so agree the window with portal owners, announce it, and show a notice if search will be incomplete. Run the rebuild with ckan search-index rebuild as your version's documentation describes, and confirm how it handles datasets changed mid-run before production. Rehearse the full sequence on staging first, including the schema change and a spot check of search results for datasets, organizations and extension fields.

Limits to confirm for Solr 9 for CKAN before go-live

Each card names one limit to confirm before the Solr 9 setup goes live, along with who can confirm it: the CKAN changelog, vendor documentation, or your own staging environment. Treat each answer as a go-live criterion and record it alongside the Solr image tag you deploy.

Solr image tags per CKAN version

The CKAN install guide says Solr and Redis can run from Docker images tagged per CKAN version, so the Solr image you pull has to match the CKAN release you deploy. Check the published tags for your exact CKAN version before you write a Compose or Kubernetes manifest. Then confirm in staging that the Solr container starts and loads the schema your CKAN version expects. Record the tag in your change record so a later CKAN patch does not silently change it.

Install from source docs

Extension index fields and schema

Extensions can add fields to the search index, and each added field needs a matching entry in the Solr schema before CKAN indexes datasets that use it. List every field your extensions index, including DCAT or custom scheming fields, and confirm the list in each extension's repository. Compare that list with the schema file your Solr image ships with. If a field is missing, plan a schema change and a full index rebuild in staging, because existing datasets keep their old index entries until they are reindexed.

Solr host sizing for dataset count

Solr memory, CPU and disk needs grow with your dataset count, resource count and number of indexed fields, so size the host from measured results. Ask your vendor for sizing guidance, but confirm the figures yourself. Run a full index rebuild in staging against a copy of your production dataset count, and watch heap use, rebuild duration and query latency during the run. Size the production host from those results with headroom for growth, and repeat the test after any schema change.

Solr 8 support for your version

CKAN 2.10.3 added Solr 9 support, and CKAN 2.11 still works with the 2.10 Solr schema while recommending the 2.11 schema. If you run Solr 8 today, confirm whether your CKAN version still supports it and which schema it expects. Check the CKAN changelog for release-specific notes, then decide whether to move to Solr 9 before or after go-live. Keep the Solr major version and the schema file pinned together so that a change to one does not leave the other behind.

CKAN changelog

Managed search or Kubernetes Solr

A managed search service or a Solr deployment on Kubernetes may not accept the schema file CKAN needs, may not expose the Solr API to your CKAN web and worker pods, or may not let you configure authentication and TLS the way your security team requires. Confirm whether you can upload a custom schema in the vendor documentation, along with the Solr version offered and the network paths and ports reachable from CKAN. Verify the same points in staging before you commit to the service.

What does setting up Solr 9 for CKAN cost and how long does it take?

What does a fixed-scope Solr 9 setup for CKAN include?

A fixed-scope Solr 9 setup covers the search index layer that CKAN queries, and the written scope states exactly what is included before work starts. Typically the work covers installing Solr 9 in infrastructure you control, configuring the schema that matches your CKAN version, connecting CKAN to the Solr core, checking search results against your data, and documenting how to rebuild the index. The scope also names the environments in play, the extensions that add index fields, and the depth of verification. Deliverables and timelines are agreed in writing, so you know what you receive before work begins. To get a quote, send the list of environments, extensions and hosting details.

What drives the cost of a Solr 9 setup for CKAN?

The main drivers are the number of CKAN environments, the extensions that add index fields, the network and TLS requirements, and how deep verification goes. Each environment, such as development, staging and production, normally needs its own Solr setup and checks, so more environments mean more installation and testing. Extensions that add fields to the search schema need schema changes and reindex tests. Network segmentation, internal certificate authorities and TLS between CKAN and Solr add configuration and review effort. Verification can range from a basic search smoke test to a documented test plan run against a dataset sample. Ask for a quote that prices each driver as a separate line item, so you can reduce one without reopening the whole scope.

How long does a Solr 9 setup for CKAN take to complete?

Duration depends on your environment, so a responsible estimate needs a written scope. The variables are the number of CKAN environments, the extensions and schema changes involved, the network and TLS rules that apply, and how quickly your teams approve access and change windows. Each one can add or remove steps. DeployOpen states the timeline in the written scope, after reviewing the environment and requirements. Your CKAN version also matters: the 2.11 Solr schema is recommended for CKAN 2.11, and the 2.10 schema still works there, which changes the schema work. For an early view, note your CKAN version, your extensions, your hosting platform and your change calendar.

Can our own team set up Solr 9 for CKAN without a partner?

Yes, an internal team can set up Solr 9 for CKAN if it has the skills and time to test the result. The work needs Linux administration, working knowledge of Solr configuration and schema files, an understanding of how CKAN builds and rebuilds its search index, and a way to test against a staging copy. CKAN added Solr 9 support in version 2.10.3, and the 2.11 schema is recommended for CKAN 2.11 (see the CKAN changelog). Matching the schema to the CKAN version is the step most likely to need care, so confirm your team can read the changelog and test the result before deciding to proceed alone.

What do we need to provide before a Solr 9 setup starts?

You provide access, a staging environment, a dataset sample and a change window. Access means accounts or a jump host into the hosting environment, with rights to install packages, edit configuration and restart services. A staging environment that mirrors production lets the setup be tested before it touches live search. A dataset sample, anonymized where personal data is involved, shows how production-like metadata and extension fields behave in the index. A change window is a period your operations team approves for restarts and reindexing. Name a technical owner who can answer questions and approve changes during the work. Confirm these items in the written scope, because missing ones usually move the timeline.

Does DeployOpen issue audit reports for a Solr 9 setup?

No. DeployOpen does not issue audit reports, attestations or certifications, because independent auditors and certification bodies issue those. DeployOpen can prepare the systems, configuration records and evidence that a compliance assessment asks for, such as documented Solr settings, access controls and verification results for search infrastructure. Ask your auditor which evidence they expect for search and logging before the work starts, so the records match their request. The auditor or certification body then forms its own conclusion from that evidence.

Security controls for a Solr 9 search index behind CKAN

Solr sits between CKAN and its users, and it holds a copy of dataset metadata, including records for private datasets. The six controls below cover where Solr runs, who can administer it, how backups and configuration are handled, which image versions run, and whether failed index updates get noticed. Each card names the risk and a check you can run in your own environment.

Keep Solr off public networks

Solr has no reason to face the internet. Its clients are the CKAN web and worker hosts, which send search queries and index updates when datasets change. Place Solr and Redis on a private subnet and allow inbound traffic to the Solr port only from CKAN hosts. Confirm the exact port and firewall rules for your deployment. Check that a connection to the Solr port succeeds from each CKAN host and fails from any external network.

Restrict the Solr admin interface

The Solr admin interface can change collections and read configuration, so ordinary users and public networks should not reach it. Limit it to a management network or a bastion host. Turn on authentication where your Solr 9 release supports it, and confirm which authentication and authorization options that release provides before you rely on one. Check that unauthenticated admin requests are refused from a CKAN host and from outside your network.

Protect backups and snapshots

The index holds metadata for private datasets, so a snapshot carries the same sensitivity as the CKAN database. Because CKAN can rebuild the index from its database, you may choose not to back up Solr at all. If you keep snapshots, encrypt them at rest and store them under the same access rules as your PostgreSQL dumps. Restore a snapshot to a test host and confirm that anonymous users cannot query its private dataset records.

Pin Solr and Redis image tags

The Solr schema has to match the CKAN version. CKAN 2.10.3 added Solr 9 support, and the 2.11 schema is recommended for CKAN 2.11. An unpinned latest tag can pull an image that no longer matches your release. Pin each image to a tag that fits your CKAN version, then review patch releases on a schedule. CKAN supports the latest patch of the current minor and the previous minor, and drops older patches once a newer one ships.

CKAN release policy

Keep Solr URLs and credentials managed

The CKAN configuration names the Solr URL, and if you enable Solr authentication, it also holds Solr credentials. A plain file in a repository or on a shared web root exposes both. Store the URL and credentials in your secrets manager, inject them as environment variables at runtime, and rotate them when staff or hosts change. Search the image, the repository and ckan.ini for Solr passwords, and confirm none appear.

Monitor failed indexing jobs

When an index update fails, a dataset can be saved in CKAN but missing from search, or a deleted or newly private dataset can still appear in results. That gap is a control problem as well as an operations one. Alert on failed or stalled background indexing jobs, and compare dataset counts between CKAN and Solr after each schema change. Make a test dataset private, then confirm the index reflects the change and that the job is logged.

How DeployOpen scopes and verifies Solr 9 for your CKAN portal

DeployOpen plans Solr 9 for your CKAN portal as a fixed-scope piece of work, starting from the CKAN version you run and the schema that matches it. We build the search service inside your own infrastructure, test that search and index rebuilds behave as expected, and hand over the configuration and runbook your team needs to operate it.

How we scope

  • We confirm your CKAN version, Python and PostgreSQL versions, and target Solr release before work starts.
  • The written scope names the schema that matches your CKAN release, since CKAN 2.11 recommends its own schema.
  • Engagements are fixed-scope, and ongoing support can be added later as a retainer.

How we build

  • Solr runs in your infrastructure, deployed from the CKAN Solr images or your approved build, with versions pinned.
  • The CKAN configuration points at the Solr core, and we check that the schema matches the CKAN version in use.
  • We run a test index build and search queries, then document when a rebuild follows a schema change.

How we hand over

  • Deliverables include the Solr configuration, the CKAN settings used, and the version record for each component.
  • A runbook covers index rebuild steps, restart order and what to check after a CKAN or Solr change.
  • We walk your operators through the runbook so they can run routine index steps themselves.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers for Solr and CKAN changes.
  • Solr and CKAN upgrades are planned together, because minor CKAN releases may include backwards-incompatible changes.
  • We check which CKAN patch you run, since outdated patch releases lose support once a newer patch ships.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.