Query Elevation - Pin & Exclude Results

Editorial control over search results

Query Elevation

Query Elevation gives you editorial control over search results. Pin important results to the top, exclude irrelevant ones, or hide a page from every query β€” directly from the search results page or the admin Elevation tab.

Enabling elevation

Navigate to the Elevation tab in Settings → Opensolr Search. The tab checks whether the QueryElevationComponent is active on your Solr index:

Active

A green badge confirms elevation is enabled. You can start adding rules immediately.

Not enabled

A warning banner appears with an "Enable Elevation" button. Click it to call the Opensolr API, which configures Solr's QueryElevationComponent on your index.

Auto-enabled on setup

If you created your index through the plugin's Save & Connect flow, elevation is already enabled. You can skip straight to adding rules.

Adding elevation rules

Each rule consists of a search query and a document URL. You can add rules two ways:

Method 1: From the search page (recommended)

Admin users see elevation controls on every search result:

  1. Log in as a WordPress admin and visit your search page at /opensolr-search
  2. Search for the query you want to control (e.g. "pricing")
  3. Each result shows PIN, EXCLUDE, EXCLUDE ALL, and REMOVE buttons
  4. Click the appropriate action β€” changes take effect immediately, no page reload needed

Method 2: From the Elevation tab

On the Elevation admin tab, fill in:

  • Search Query β€” the exact query this rule applies to (case-insensitive)
  • Document URL β€” the full URL of the page to pin or exclude
  • Action β€” Pin to top or Exclude from results

Elevation actions

PIN

Forces a result to the top for a specific query. Uses Solr's elevateIds with forceElevation=true. Status label: Pinned (orange).

EXCLUDE

Hides a result for a specific query. Uses Solr's excludeIds. Status label: Excluded (red).

EXCLUDE ALL

Hides a result from every query. Saved with query_text='*' (wildcard). Works even when no search term is active. Status label: Excluded (all) (red).

REMOVE

Removes all elevation rules for a document. Only visible when the result already has rules (PIN, EXCLUDE, or EXCLUDE ALL).

Drag-and-drop reordering

When multiple results are pinned for the same query, a drag handle appears on each pinned result. Drag to reorder β€” the new positions are saved automatically via the REST API. Powered by SortableJS.

How it works under the hood

  • Document IDs are MD5 hashes of the document URI β€” the same ID used in the Solr index
  • Rules are stored in the WordPress database in the opensolr_search_elevations table
  • Solr integration β€” on each search, pinned IDs are passed as elevateIds and excluded IDs as excludeIds with forceElevation=true
  • Global rules (EXCLUDE ALL) use query_text='*' and are included in every query
Exact query match

Elevation rules match the exact query text (case-insensitive). A rule for "pricing page" won't apply to "pricing" or "page pricing". Create separate rules for each query variation you want to control.

Common use cases

Promote key landing pages

Pin your pricing page to the top for "pricing", "plans", and "cost". Pin your contact page for "contact", "support", "help".

Hide outdated content

An old blog post keeps appearing for "getting started"? Exclude it for that query. The page stays on your site β€” just not in that search result.

Remove internal pages entirely

Use EXCLUDE ALL to hide test pages, staging URLs, or internal-only content from every search query.

Admin-only controls

Elevation buttons are only visible to logged-in WordPress administrators. Regular visitors never see the PIN/EXCLUDE controls on the search page.

For more on configuring search results, see Search Tuning and Analytics.