Search API and Solr for listings that scale
A catalog page can load quickly until someone combines a category, a price range, and several product attributes. Then the results crawl, facet counts lag, and every uncached request adds pressure to Drupal’s database. A Drupal Search API Solr setup can move that filtering and sorting into a search index, keeping useful listings within reach as your catalog grows.
That matters for visitors and AI assistants fetching pages to compare products or identify suppliers. Both need timely, accurate information. But adding Solr introduces another service to run, so the decision should start with measurements rather than an entity-count threshold.
In this article:
- When does the database stop being enough?
- What does the setup need?
- How should catalog attributes support facets and comparisons?
- How should each index handle languages?
- What happens while content is being reindexed?
- What response-time improvement should you expect?
- What will running Solr cost your team?
When does the database stop being enough?
The first warning usually comes from a specific page rather than the whole website. A category listing works well with one filter, but slows down when visitors combine several. Facet counts may take longer to calculate than the results themselves.
Other signs include database CPU spikes during catalog traffic, slow queries joining several field tables, and large differences between cached and uncached responses.
A few thousand entities are a reason to measure, not an automatic reason to migrate. A simple listing can remain fast at much larger volumes. A smaller catalog with complex permissions, translated content, many attributes, and concurrent requests can struggle sooner.
Start with representative requests:
- A popular category with no filters.
- A frequently used combination of attributes.
- A broad result set with facet counts and sorting.
- Cold-cache requests and requests from relevant user roles.
- Concurrent visits across different filter combinations.
Measure the database queries behind those pages. Query changes, fewer joins, or more effective caching may address the bottleneck without another service.
AI assistants add another reason to examine uncached requests. They may follow unfamiliar combinations of URLs that your cache hasn’t seen recently. A slow fetch can time out or leave the assistant with incomplete evidence, although different tools use different time limits. There is no universal response budget for all assistants.
What does the setup need?
The goal is to let Drupal keep control of content while Solr handles queries that become expensive against relational content tables.
Three parts work together:
- Search API defines which Drupal data enters an index and how Drupal queries it.
- Search API Solr connects that framework to Solr.
- The Solr service stores indexed documents and executes search, filtering, sorting, and facet calculations.
Drupal remains the source of truth. The index is a query-oriented copy of selected data.
Establish the connection
First, check compatibility across your Drupal version, Search API, Search API Solr, and Solr release. Use the connector’s matching Solr configuration rather than assuming a default Solr installation has the field types and analysis settings Drupal needs.
Provision the service, apply that configuration to the appropriate core or collection, and create a Search API server in Drupal with the connection details. Check connectivity from the application environment. For a hands-on walkthrough of the module configuration, see our guide to building a product search engine in Drupal with Apache Solr.
Then define an index. Choose its data sources and bundles before selecting fields. If the listing contains products, indexing unrelated articles and landing pages will add noise and indexing work.
Select fields around listing behavior
Every field needs a purpose: finding a result, filtering it, sorting it, or presenting it accurately.
| Field group | Typical contents | Purpose |
|---|---|---|
| Identity | Entity ID, bundle, stable product identifier | Identify results and connect them to source content |
| Visibility | Publication status and supported access metadata | Support the intended visibility rules |
| Language | Translation language | Return the intended language version |
| Search text | Title, summary, description | Match words and phrases |
| Categories | Stable taxonomy identifiers | Filter by category consistently |
| Comparison attributes | Capacity, dimensions, material, availability | Support precise filters and comparisons |
| Sort values | Numeric price, date, sortable title | Produce predictable ordering |
Only index sensitive fields when the application genuinely needs them and the access design covers their use.
Review processors and connect the listing
Processors can prepare text, handle entity status, or contribute access-related behavior. Their availability and effect depend on the installed modules, data sources, and configuration. Review them individually.
Connect a Search API-backed View and facet tooling compatible with your module versions and display approach. Then test representative queries as anonymous visitors, signed-in users, and restricted roles.
Check counts as well as results. Hiding an inaccessible entity during rendering may still leave misleading totals or reveal its presence through facets. Don’t assume that moving a listing to Search API automatically reproduces every custom Drupal access rule.
How should catalog attributes support facets and comparisons?
Reliable facets start with consistent source data. Solr can query attributes quickly, but it cannot decide whether “500 ml” and “0.5 L” describe the same capacity unless your data model makes that relationship explicit.
Keep full-text fields separate from exact-match fields. A description benefits from language-aware text analysis. A product code, category identifier, or material option needs predictable matching without that analysis changing its meaning.
Choose types deliberately:
- Use numeric values for prices and measurements.
- Store dates as dates rather than display strings.
- Represent yes-or-no attributes as booleans.
- Preserve multiple values for products with several categories or supported standards.
- Provide a sortable field when display text is unsuitable for ordering.
Suppose suppliers submit capacity in both liters and milliliters. Normalize it to a common numeric unit before indexing, while retaining the preferred display value for the product page. Range filters can then compare equivalent specifications.
Prices need context too. Comparing numeric amounts across currencies without conversion or a currency filter will produce misleading results.
For taxonomy facets, use stable term identifiers for filtering and translated labels for display. Labels can change without changing which category a filter represents.
Agree on counting behavior before launch. Should selecting two materials mean either material or both? Should a facet show counts after applying its own selected values, or only the other active filters? How will products with missing attributes appear?
These decisions affect what visitors think the catalog contains. Keep the indexed attributes aligned with product pages, structured data, and feeds so an assistant doesn’t encounter conflicting facts across formats. Our article on building a Drupal product catalog without Commerce explains how to model those attributes before they reach the index.
How should each index handle languages?
Language handling affects whether people find the right products and reach pages they can read.
You can use a shared multilingual index or separate indexes by language. A shared index can reduce duplicated configuration and make cross-language queries easier. Separate indexes can help when languages need distinct query behavior or operating schedules, but they add configuration and maintenance work.
The right choice depends on query requirements, analyzer support, and the connector’s configuration. Separate indexes don’t automatically mean separate Solr servers, and neither approach removes the need for language-aware setup.
Check how your chosen data source indexes translated entities. Then ensure listing queries apply the intended language filter. Otherwise, results may include several translations of the same product or link to an unexpected version.
For full-text search, use language-appropriate analysis, including stemming and stop-word handling where suitable. Keep identifiers and exact-match attributes outside that linguistic processing.
Test the whole path:
- Search terms in each supported language.
- Translated facet labels.
- Products that lack a translation.
- Any fallback to the default language.
- Links to the correct translated page.
Make fallback behavior deliberate. Showing default-language content may be useful, but visitors need a predictable experience. Separate language indexes will also need their own coverage checks and rebuild planning.
What happens while content is being reindexed?
Saving content and making it searchable are separate events. Depending on your configuration, Search API may index changes during the request or leave them for scheduled processing. Solr’s visibility settings can also affect when an update appears in queries.
Define an acceptable delay. A revised description may tolerate a longer wait than a withdrawn product or restricted document.
Schedule indexing to meet that need, and monitor both the remaining backlog and how old pending changes are. A successful scheduled task doesn’t prove the index is current.
Routine updates versus full rebuilds
Routine indexing updates changed items and removes deleted ones. A full rebuild revisits the data after changes such as new fields, different processors, or revised Solr analysis.
Marking items for reindexing is different from clearing the live index. When the existing documents remain, older indexed values may stay searchable until replacements arrive. During that period, results can reflect a mixture of old and new processing.
Clearing the live index removes that coverage. Listings may become empty and then partially populated as indexing progresses. Some schema changes may also make retaining the old documents unsuitable.
For sites that need uninterrupted catalog coverage, plan a separate rebuild:
- Prepare a second index or collection with the new configuration.
- Populate it while the current one continues serving requests.
- Capture changes and deletions that occur during the rebuild.
- Validate coverage, queries, facets, languages, and access behavior.
- Switch traffic using a tested method appropriate to the deployment.
A Solr collection alias may support that switch in a suitable SolrCloud setup. Other deployments will need a different approach, including compatible Drupal configuration changes and a rollback plan.
Pay special attention to unpublished, deleted, and newly restricted content. A replacement index populated from older data can accidentally restore records that should no longer appear.
Finish with validation, not just a completed progress bar.
What response-time improvement should you expect?
Solr can reduce the time spent filtering and calculating facets because it uses an index built for those operations. Drupal no longer needs to repeat the same expensive joins across content tables for each search-backed listing.
That benefit can be substantial when those queries dominate the request. It won’t fix unrelated delays.
Measure the complete page response, including:
- The request from Drupal to Solr.
- Entity loading for returned results.
- Access checks.
- Rendering and any external calls.
- Cache behavior and network latency.
A quick Solr query can still feed a slow page if Drupal loads excessive related data or calls another service for every result.
Compare the same requests before and after the change, under representative concurrency. Track median response times and slow-tail measures such as the 95th percentile. Averages can hide the requests that frustrate visitors.
Include facets with many distinct values, broad result sets, different sort orders, and cold caches. Test while indexing runs too, since indexing and searches compete for resources.
For machine consumption, speed is only part of the result. Keep useful content available in crawlable HTML or an intentional API or feed, with stable links to source pages. A fast listing that exposes stale attributes or depends entirely on browser interaction may still be difficult for a fetcher to use.
Solr supports timely retrieval. It doesn’t guarantee that an assistant will discover, select, or recommend your site.
What will running Solr cost your team?
Solr adds a recurring operating cost, even when the software carries no license fee. Budget for hosting, memory, CPU, storage, monitoring, upgrades, recovery work, and staff time.
Capacity planning needs to cover both searches and indexing. A separate rebuild may temporarily require additional storage and compute, while a large content import can create a burst of indexing work.
Managed hosting can move some service maintenance to a provider, so treat it as part of choosing your Drupal hosting. Check who will handle backups, restore testing, security updates, capacity changes, and incidents. Your Drupal team will still need to own field selection, query behavior, and source-data accuracy.
With self-hosting, your team will take on more of the service operation directly. Include that time in the comparison rather than comparing hosting bills alone.
Keep Solr accessible only to authorized services through appropriate network restrictions and authentication. Avoid exposing its query or administration endpoints directly to public visitors. Coordinate upgrades across Drupal modules, connector configuration, and the search server.
Plan for outages, too. Decide whether visitors will see cached listings, a limited browse page, or a clear retry message. Automatically sending the full search workload back to Drupal’s database can recreate the bottleneck at the worst moment.
Test recovery. Even an index that can be rebuilt from Drupal may take too long to restore from scratch for your availability needs.
The decision rule is practical: keep database-backed listings while they meet measured needs; add Solr when faster queries, usable facets, and reduced database pressure justify another service.
Ready to start?
Bring your slowest catalog pages to a conversation with Droptica. Representative filter combinations, current response times, content volume, and freshness needs will give us a useful starting point.
We’ll help assess whether query changes, caching adjustments, or a Solr-backed index will be the more useful next step, with a clear view of the indexing work and running costs involved.