Why datasets go missing from the CKAN Solr search index and when to rebuild it
A dataset that is live in the database but absent from search usually means the Solr index has drifted from the database. CKAN keeps Solr as a derived copy of its database content, so failed indexing jobs, restores from backup, schema changes and permission changes can each leave some records out of step, and a rebuild rewrites that copy from the database. Before you rebuild, check the one dataset. Open its page as a sysadmin and as an anonymous visitor, confirm its state is active, and confirm its organization and visibility are what you expect. If only that record is wrong, reindexing it is the narrower fix. A rebuild is the right step when several datasets are missing, when search results disagree with dataset pages, or after a change to the Solr schema or permission model.
A full rebuild reads every active dataset from PostgreSQL and writes it into Solr, so its run time grows with the size of the catalog, and it loads both the database and the search server while it runs. Schedule it outside peak use, take a database backup first, and confirm the exact command and options for your release in the CKAN documentation, because command names and options can differ between releases. Record the portal version, the start and end times, and the datasets you checked before and after the run. That log lets you trace a later missing dataset back to a known event instead of guessing at its cause.
This page covers how to tell unindexed datasets from stale ones, full and partial rebuilds, the faster option for large portals, clearing orphaned index entries, and reindexing after schema or permission changes. Each step names the CKAN component it touches, so you can match it to your own deployment, which usually includes the database, the Solr server, Redis and background workers. Before you run any command, confirm it in the documentation for your portal's release. The CKAN release policy explains which minor and patch releases still receive fixes, which tells you whether you are reading the right version of the docs.
How CKAN keeps the Solr search index in step with the database
The diagram starts at the web interface and API, where a dataset is created, updated or deleted. CKAN writes the change to PostgreSQL and updates the Solr index, which then serves search reads. Redis and a background worker sit beside the write path, and the rebuild command reads PostgreSQL to rewrite Solr. The subgraph marks the trust boundary between the CKAN host and the Solr endpoint, so confirm that Solr accepts connections only from the CKAN host. Confirm in your installed version whether index updates run synchronously on save or through a worker. An orphaned entry appears when a dataset is removed from PostgreSQL without a matching removal from the index.
Writes reach PostgreSQL and Solr, and rebuilds rewrite Solr from PostgreSQL.
Symptoms that point to an unindexed or orphaned dataset
Each symptom below looks like missing or wrong search results, but the cause may sit in the database, the permission model or the Solr version. Confirm that each one is an index problem before you start a rebuild, because a rebuild only corrects what the index holds. Give the first check to the person who can see the source of truth for that symptom.
Dataset in database, missing from search
The dataset opens by its URL and counts toward its organization, yet a keyword search never returns it. This usually means the dataset was created or updated while the index was not written, for example during a failed background job or a Solr outage. Check first: open the dataset as a sysadmin, then run ckan search-index check on the CKAN host to list datasets the index does not hold. The portal sysadmin or platform engineer with shell access should run it.
Deleted dataset still in results
A dataset deleted in the web interface still appears in search, or its link returns a not-found page while its title still ranks. Deleted datasets stay in the database until they are purged, and a stale index entry can keep them visible to searchers. Check first: confirm the dataset state through the API with a sysadmin account and compare it with the search hit. The portal administrator should decide whether a purge is appropriate, since purging is a separate step from reindexing.
Facet counts disagree with the list
The facet sidebar reports more datasets for an organization or tag than the result list shows. Facets and results come from the same index, so a mismatch often means some documents are stale or only partly written. Check first: apply a single facet filter and compare the count with the total returned by the search API for the same query. A portal administrator who can read both the API output and the server logs should run this check.
Private datasets visible to wrong users
After a member's role changes, or a dataset moves from private to public, search may still show the old visibility. Search results filter by permission labels stored in the index, so stale labels can expose a dataset to the wrong audience. Treat this as a security incident first: confirm the private flag in the database, search as an anonymous user and as a member of another organization, and report the result to your security owner before any rebuild.
Stale results after Solr change
Upgrading Solr, editing the Solr schema, or moving CKAN to a new release can leave the index built for the old layout. Search may miss fields, return odd matches or fail on new filters. CKAN's source install guide recommends Solr 9 and also lists Solr 8, so compare the running Solr version with your CKAN release notes first. Check first: have the platform engineer who made the change confirm the Solr version and schema file match what your CKAN release expects.
Install from source guideMissing results after database restore
A database restore brings back datasets, but search still reflects the state before the restore because the Solr index was not restored with it. Datasets created after the backup point may also be absent from search. Check first: compare the dataset count for one organization in the restored database with the count in search. Ask the engineer who ran the restore which database dump and which index snapshot were used, and confirm the procedure with whoever owns backups.
Full, partial and rebuild-fast options for the CKAN Solr search index
This table compares the ways to rebuild CKAN's Solr search index, from a full rebuild to targeted, faster and cleanup-focused options. Read each row by its trigger first, then check the trade-off and the items to confirm for your CKAN and Solr versions. The main takeaway is that the faster options depend on details you must verify before a production run, so confirm them in a test environment first.
| Option | When to use it | Trade-off | What to confirm for your version |
|---|---|---|---|
| Full rebuild | Most datasets appear missing or wrong after a Solr move, restore or index corruption | Touches every dataset, so it takes the longest and search results may be incomplete while it runs | Exact command syntax, whether the site stays usable during the run, and Solr 8 or 9 compatibility |
| Partial rebuild by dataset or organization | A known set of datasets or one organization is missing or out of date | Lower load and faster, but it only fixes what you target, so you need an accurate list of affected IDs | Whether you can target by dataset ID, and whether organization-level selection is supported in your release |
| Rebuild-fast for large portals | Full index coverage is needed quickly on a large catalog | May skip some per-dataset steps, and failures can be harder to trace than in a standard rebuild | What it skips (validation, extras, resource data), how failures are logged and retried, and whether a site-wide pause is required |
| Orphan clearing | Search returns datasets that were deleted or purged in the database | Removes index entries, so a wrong scope can hide valid datasets from search | Whether clearing runs as a separate step or inside a rebuild, and whether it respects your site ID |
| Reindex after schema change | The Solr schema or the fields CKAN indexes have changed during an upgrade or extension change | Usually requires reindexing all datasets, and old fields remain until the reindex completes | Which schema file your CKAN version expects, and whether the schema is loaded before the rebuild starts |
| Reindex after permission change | Dataset visibility, organization membership or collaborators changed and search results look wrong | Permissions are stored in the index per dataset, so the scope must cover every affected dataset | Whether your version reindexes automatically after permission edits, and whether collaborator changes are included |
Checking for unindexed datasets before you rebuild the CKAN search index
Before you rebuild anything, compare what PostgreSQL says should be searchable with what Solr actually holds. Count the active datasets in the package table, where state is active, and count the datasets Solr returns for the same scope. On the API side, a package_search call with rows set to 0 returns a total count in the result. Private datasets must be included on both sides, because CKAN indexes them too. If the two totals match, the gap is unlikely to affect the whole index, so move to an ID-level check. Confirm the exact ckan search-index subcommands, options and output formats for your installed version in the CKAN documentation, since they can change between releases, and run the comparison against a copy of the portal first.
Next, compare the dataset IDs on each side. Missing datasets are active in PostgreSQL but absent from Solr. Orphans are the reverse: records still in the index after they were deleted or purged from the database. Use ckan search-index check to list datasets missing from the index, and ckan search-index show with a dataset ID to inspect an orphan candidate (confirm both in your version's docs). Then apply the decision path. A handful of mismatches points to a targeted reindex of those IDs. Mismatches spread across much of the catalog point to a full rebuild. A mismatch that appears straight after a restore points to restore verification instead: check restored row counts against the backup record before rebuilding, because rebuilding over a faulty restore can hide the original fault.
Record the counts, the ID lists and the chosen path before you change anything, so the outcome can be checked later. Agree in writing with the team that owns the portal what counts as a handful and what counts as widespread, since no single number suits every catalog. Purged datasets also affect harvest sources and the index, so check the purge procedure to decide whether a leftover ID in Solr is an expected artifact or a fault. Run the targeted reindex on a copy of the portal first, then repeat both counts on production. If the counts still differ, escalate and investigate the cause instead of starting a full rebuild, because a full rebuild on an unexplained gap may leave the underlying fault in place.
Running a CKAN Solr search index rebuild with checks at each stage
This sequence rebuilds the Solr index behind a CKAN portal so that every dataset that should be searchable is found and no deleted dataset still appears. Each stage has a named check, so the team can stop before production if staging counts or sample searches do not match. The output is a run record covering versions, backups, counts and orphan cleanup that the portal owner can keep.
Confirm CKAN and Solr versions
Compare the CKAN version and the Solr version on the portal against the supported combinations in the CKAN install from source documentation. Solr 9 is recommended and Solr 8 is supported, so a Solr 8 server can proceed but should go on the upgrade list. Check the CKAN patch level as well, because outdated patch releases lose support once a newer patch is out. Confirm the exact Solr version from the Solr admin page or your package manager, and confirm the exact rebuild commands and flags for that CKAN version. The step is done when both versions are written in the run log and match a supported combination.
Back up the database and Solr index
Take a dump of the CKAN main PostgreSQL database and, if the portal uses the DataStore, a dump of the DataStore database. Then copy or snapshot the Solr core or index directory, using the method your Solr version and storage support. Ask the team to confirm the exact dump commands, file paths and snapshot steps, and whether the site must be paused while the copies are taken. Store the copies outside the host being rebuilt and record their checksums and timestamps. The step is done when a test restore of the database dump succeeds in a scratch environment and the Solr copy is confirmed readable.
Check web, worker and Redis health
Confirm that the web processes serving CKAN, the background workers and Redis are all running and responding before anything is changed. Load the portal front page to confirm the web processes answer, check that the workers are picking up jobs from their queues, and run a Redis ping from the CKAN host. Record any stuck or failed jobs, because a rebuild that starts alongside a backlog makes it harder to tell whether missing datasets come from the index or from queued work. Ask the team to confirm the worker and Redis commands for their deployment, and whether indexing jobs queued during the run will be replayed. The step is done when all three components report healthy and the job backlog is written in the run log.
Run the rebuild on staging
Run the chosen rebuild option on a staging copy built from the production backup, with the same CKAN and Solr versions as production. The options covered in this topic are a full rebuild, a partial rebuild and rebuild-fast for large portals, so the team picks one and records the reason. Confirm the exact search-index command, its flags and any required environment settings in the documentation for the CKAN version in use. Watch the command output and the Solr log for errors. The step is done when the command exits without errors and the logs show no datasets left unindexed or failed.
Run the rebuild on production
Run the same command with the same flags against production, and only after the portal owner has approved the maintenance window in writing. Agree beforehand whether the site stays online, goes into maintenance mode or pauses write actions, because datasets created or edited during the run may be indexed late or missed. Confirm this decision with the team and the owner before the window opens. Watch the command output and the Solr log from start to finish. The step is done when the command completes without errors and the owner has been told the run ended, with start and end times recorded.
Verify counts and sample searches
Compare the number of datasets in the Solr index with the number of active datasets in the CKAN database, and repeat the comparison for organizations and groups if the portal searches them. Then run sample searches as an anonymous user and as a member of the owning organization. Include one private dataset, which should appear only to members, and one deleted dataset, which should not appear in search results for anyone. Confirm the count query and the search calls with the CKAN version in use. The step is done when the counts match or each difference has a recorded explanation, and both sample datasets behave as expected.
Clear confirmed orphans from the index
Identify index entries that point to datasets no longer present in the database, then check each ID against the database before removing it. Remove only the entries confirmed as orphans, and leave private and draft datasets in place, since they are valid index content. Confirm the orphan-clearing command, its flags and whether it needs the site paused, with the documentation for the CKAN version in use. Re-run the count comparison from the previous step afterwards. The step is done when the orphan list is empty or each remaining entry has a recorded reason.
Record the outcome in the run log
Write a run record that names the CKAN and Solr versions, the rebuild option chosen and the reason for it, the backup locations and checksums, the approved window and approver, and the exact command and flags used. Include the counts before and after, the sample search results, the orphan IDs removed and any datasets still unresolved, with an owner for each. Keep the record with the backups, because the portal owner will need it if search problems return. The step is done when the portal owner has reviewed and accepted the record in writing.
How the rebuild path changes for small, large and multi-site portals
On a single-site portal with a catalog your team can review, a full rebuild is usually the simplest path. The index is small enough to plan around, and a full run has little chance of touching another site's documents. The main risk is that a rebuild reads the database as it stands, so unfinished edits or a stopped job can leave an index that looks complete but is not.
- Decision: run a full rebuild after the check step lists the datasets that are missing from search, and skip partial runs unless you already have an exact dataset list.
- Risk: search results may be incomplete while the rebuild runs, so schedule it for a quiet period and tell the portal owners when it starts and ends.
- Measure on a copy: the number of datasets the check step reports before and after the run, and whether private datasets appear in anonymous search.
- Verify by sampling: open a few datasets from each organization in the web interface, since matching counts alone do not prove that the right records are indexed.
Before the production run, confirm that no background jobs are changing datasets, and keep the check output as a record of the starting state.
On a large portal, a full rebuild can run long enough to affect search availability and to delay other changes, so teams often consider rebuild-fast or a partial run. These options save time but change what gets indexed and how the run picks up records, so each option needs measurement on a staging copy first. The risk is a faster run that leaves stale or missing entries that nobody notices until a user reports them.
- Decision: choose
rebuild-fastonly if your CKAN version supports it and the staging result matches a full rebuild for a sample of datasets. - Risk: a partial run skips every dataset you did not list, so the index can drift from the database without any error message.
- Measure on a copy: elapsed time for each approach, memory and disk use on the Solr host during the run, and the dataset counts from the check step afterwards.
- Compare search results: run the same set of queries before and after the run, and record which datasets appear in one result set but not the other.
- Confirm capacity: check that the Solr host and the web and worker servers have enough headroom for the load the run creates.
Record the measured results and the exact command used, so the production run can be repeated and audited.
When several CKAN sites share one Solr server or core, no single portal owns the index. Each site is identified by its ckan.site_id value, and a rebuild or clear run under the wrong identifier can remove or duplicate another site's entries. The damage is hard to see from inside one site's interface, so the identifier and the index scope must be confirmed before any run.
- Decision: confirm that each site's
ckan.site_idis unique and that the run targets only the intended site before choosing a full, partial or fast path. - Risk: a clear or rebuild under the wrong identifier can remove entries that belong to other sites, and those owners may only notice the loss later.
- Measure on a copy: the document count for each site identifier before and after the run, using a copy of the shared Solr data.
- Coordinate the window: agree a time with the owners of every site that uses the shared index, since one site's run can change search results on the others.
- Check the job queues: confirm that background job queues are named with each site's identifier, so jobs for one site are not picked up by another site's workers.
Write the identifier, the scope and the approved window for each run into the change record before starting.
Operational risks during a search index rebuild
A rebuild reads every dataset and rewrites the search index, so the risks sit in what becomes searchable, who can trigger the change, and what shared services absorb while it runs. The six controls below cover those risks. Confirm each one against the CKAN and Solr settings on your own installation before the first run.
Private datasets in search results
A rebuild indexes every dataset it reads, including private ones, so the permission filters applied at query time decide who sees them. Confirm that each private dataset carries the permission labels your CKAN version uses, and that the search page hides those results from anonymous users and from users outside the owning organization. Run a test search as a user without access after each rebuild and before the portal is announced as back. If the test shows a private title or description, keep the search page out of service until the index is corrected.
Solr endpoint kept off public networks
Solr's HTTP interface accepts update and delete requests, so a reachable endpoint lets anyone who finds it change the index. Keep the Solr port on a private network that only the CKAN web and worker hosts can reach, and require authentication on the Solr side where your deployment supports it. Confirm that ckan.solr_url points to the internal address, and test from an outside network that the core URL does not respond. Record the result with the installation notes so the check repeats after every infrastructure change.
Limiting who runs rebuild commands
The ckan search-index commands run with the server's configuration and can rewrite or clear the whole index, so shell access to a CKAN host is the main control. Limit shell access to named platform engineers, give each operator a personal account, and run the commands as the same service user that runs the web application. Confirm which accounts can reach those hosts and which can read the configuration file that holds database and Solr credentials. Remove access for anyone who no longer runs the portal, and review the list each quarter.
Load on shared Solr and database
A full rebuild reads every dataset from PostgreSQL and sends every document to Solr, which can slow search, the DataStore and other applications that share either service. Schedule the run for a low-traffic window and avoid overlapping it with harvests, bulk imports or a backlog of background jobs. Confirm the Solr memory allocation, the database connection limits and the worker count against the portal's size before starting, and watch both services during the run. For large portals, ask whether a partial rebuild or the rebuild-fast option covers the change with less load.
Backups before clearing orphans
Clearing orphans removes index entries for datasets that no longer exist in the database, and a rebuild cannot restore them because they are not in the database. Back up the database and the Solr data directory before any clear step, and confirm on a test system that the restore procedure works. Keep the list of orphaned identifiers the check produces so the change can be reviewed. If no current backup exists, postpone the clear until one is in place and the restore has been tested.
Change records for each run
Each rebuild changes what users find, so a written record is the evidence that the change was intended and checked. Log who started the run, the CKAN and Solr versions, the exact command and options, start and end times, the check output before and after, and any errors. Store the record where the audit team can read it, and link it to the backup identifier from the previous step. Confirm that your change process requires this record before the run starts, not only after it finishes.
Limits to confirm for your CKAN version and Solr setup
Confirm your CKAN minor version before planning a rebuild, because the rebuild commands and their options belong to that release. Run ckan search-index --help on your own host and record the options it accepts, since a runbook written for another minor version may name options your installation does not have. Then check your Solr version against the install-from-source guide for the same release. That guide lists Solr 9 as recommended and Solr 8 as supported, so a portal on any other Solr version needs that gap closed before a full rebuild is scheduled. Record both versions in the change ticket so the rebuild plan can be reviewed against them.
Next, check the items that can change the plan itself. A schema change needs the Solr schema updated and the core reloaded before the rebuild, and the exact steps should be confirmed in the release notes for your minor version. Patch releases exclude schema changes, so any schema change will arrive with a minor release, which may also include backwards-incompatible changes. Confirm whether the new schema must be live before the rebuild starts and whether search answers queries or returns errors during the run. Measure duration on a staging copy of your own datasets, because no reliable figure carries over from another portal's size or hardware. Finally, list each extension that adds indexed fields or its own indexing step, such as spatial search or custom schema fields, and confirm its compatibility with the target minor version.
Plan the upgrade path alongside the rebuild, because the support window is short. CKAN's release policy says the tech team supports the latest patch of the current minor version and the previous minor version, and outdated patch releases lose support once a newer patch is out. On the CKAN releases page, 2.12.0 is the current minor, released on August 26, 2026, with 2.11.6 and 2.10.11 released the same day. A portal on 2.10 is therefore outside the supported window, and a portal on an older patch should move to the newest patch of its minor. Check the releases page for any patch published after those dates before you sign off the plan, and schedule any minor upgrade as a separate change with its own rebuild.
What buyers ask about cost, effort and time for a CKAN search index rebuild
What drives the cost of rebuilding CKAN search indexes?
Cost is driven by four pieces of work: diagnosis, staging, the change window and verification. Diagnosis confirms which datasets are missing from search and why, using the portal's logs and index counts. Staging runs the rebuild on a copy of production so the team learns the likely duration and any errors before live search is touched. The change window covers the people on call during the agreed maintenance slot, plus rollback readiness. Verification compares dataset counts and checks sample searches afterward. A single rebuild is usually a fixed-scope job with a written deliverable. Rebuilds that recur, such as after each schema change, are better handled under a retainer. Ask any quote to price each piece separately and to say which parts recur.
How long does rebuilding a CKAN search index take?
The duration depends on how many datasets and resources are indexed, how much Solr memory and CPU the host can give the rebuild, how much of the index is in scope, and which extensions add fields or hooks to indexing. A full rebuild rereads every dataset, so it grows with catalog size. A partial rebuild covers only selected datasets or organizations and finishes sooner. Extensions that index extra fields, such as spatial or harvested metadata, add work per dataset and can change run time. Solr resources matter because a rebuild competes with live search traffic on the same host. This page gives no duration because the answer varies by portal. Measure on a copy of the production data, on hardware close to production, and time both a full and a partial run. Use those measured numbers in planning and in the quote.
What does our team need to provide for a rebuild?
The work needs access, an approved maintenance window and a named person who checks the results. Access means administrator access to the CKAN host, plus credentials or network paths to Solr and the CKAN database, with read-only access at minimum for diagnosis. The approval window must be agreed in advance, with a fallback plan if the rebuild runs past it. Your named owner confirms dataset counts against the source of truth, checks sample searches and accepts or rejects the outcome. Your team also supplies the CKAN and Solr versions in use, the list of installed extensions, the configuration files and a recent database backup. Expect to provide a change record for the window and an escalation contact. Access requests move faster when they name the exact hosts, accounts and time needed.
Can our own team run a CKAN search index rebuild alone?
Yes, if your team has CKAN operations skills and confirmed commands for the version you run. Those skills include reading CKAN and Solr logs, managing the Python environment and service restarts, and understanding how the search index relates to the database. Confirm the exact rebuild commands for your CKAN version in the official documentation, then test them on a copy before production. Your team should also know how to list datasets missing from search, how to recover if a run stops midway, and how to roll back configuration changes. If one of these skills is missing, a fixed-scope engagement can cover that gap, with the handover written into the deliverables. The decision usually comes down to how much time your operators can spend on a window and who will own the result afterward.
Does rebuilding a CKAN search index delete any source data?
A rebuild should not delete source data, because the Solr index is derived from the CKAN database and can be regenerated from it. Confirm this for your CKAN version in the official documentation before you run anything. Some related actions do remove data: clearing orphaned index entries removes search records that no longer match a dataset, and purging deleted datasets is a separate step with its own effects. Before the window opens, take a database backup, copy the Solr data directory and save the configuration files. Confirm that the rebuild does not change the FileStore or the DataStore database, which hold uploaded files and loaded tables. Test the restore path on a copy so the team knows how to recover if a step behaves unexpectedly.
Does a CKAN search index rebuild need downtime?
It may, and you should confirm this for your CKAN version and deployment before planning. Whether search is unavailable during a run depends on the rebuild command used, how Solr is set up and whether the site serves search from the index being rebuilt. Some teams accept degraded search while the job runs, while others schedule a maintenance window and post a notice. Check the official documentation for whether the command rebuilds in place or builds a fresh index that replaces the old one. Plan for the worst case: a period where dataset lists and search results may be incomplete or stale. Test on a copy and time the run, so the approved window matches what you measured. Record in the change plan what users will see during the window and how you will tell them.
What should a written quote for a rebuild include?
A written quote should restate the scope, deliverables, timeline and assumptions in plain language. Ask for each cost component on its own line: diagnosis, staging, change window support, verification and handover. Each line should name who performs the work and whether it is one-time or recurring. The quote should list the CKAN, Solr and PostgreSQL versions it assumes, the extensions in scope and the hosts it touches. It should state what your side provides, including access, the approval window and the named owner. Assumptions about downtime, rollback, backups and the test copy should be written out in full. Finally, it should describe the acceptance check, such as the dataset counts and sample searches that confirm success, and what happens if the check fails. DeployOpen works from a fixed scope agreed in writing and does not publish a price list, so the quote follows from that written scope.
How DeployOpen scopes and supports a CKAN search index rebuild
DeployOpen treats a search index rebuild as scoped work on your own CKAN installation. We agree which datasets are missing, which rebuild type fits your portal, and how results are checked before and after the run. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
How we scope
- Written scope lists which portals, Solr version and CKAN version the rebuild covers.
- We check the unindexed dataset list, private and deleted datasets, and orphaned index entries before choosing a method.
- Scope also records whether the rebuild is full, partial, or a rebuild-fast run for a large portal.
How we build
- Where your environment allows, we test the rebuild on staging before touching the production Solr index.
- Solr runs on the version your installation targets, with Solr 9 as the recommended choice for CKAN installs.
- Checks compare dataset counts and sample search results against the database before sign-off.
How we hand over
- A written runbook records the commands used, the rebuild type chosen, timings observed and rollback steps.
- Your team receives before-and-after counts so reviewers can confirm missing datasets now appear in search.
- Staff are walked through the checks to repeat after schema or permission changes.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers once the rebuild is complete.
- Retainers can be scoped to re-run the index checks after upgrades, schema changes or permission model changes.
- Quotes follow from the written scope, so ask which rebuild types and checks each quote includes.

