Search Page & Embed Code

Hosted search page and embeddable search widget

Search Page & Embed Code

The hosted search page is a free, fully-featured search UI at search.opensolr.com/your-index-name — use it as-is or embed it into your own website with a single line of code. No server setup, no coding required.

Which indexes get the hosted search page?

The hosted search page is a feature of the Opensolr Web Crawler schema, not every index. It is available on:

These indexes ship with the default web crawler schema.xml, which defines the fields the hosted search UI expects (title, uri, text, facets, vectors, etc.). Plain Solr indexes with custom schemas — for example classic Search API Solr setups — do not have this page.

Quick start guides

Ready to get started? See the Embed Code guide for a step-by-step walkthrough, or check out Code Examples: Build Your Own Search UI if you want full control over the front end.

On Drupal or WordPress? Use the native CMS search UI.

The Drupal modules and the WordPress plugin render a full search page natively inside your site — with your theme, your templates, your URLs — complete with facets, autocomplete, spellcheck, and analytics. No embed code needed. Use the hosted search page here only if you are building a custom app or want a standalone search portal.

What Your Search Page Looks Like

Below is a visual overview of the hosted search page. It has three main areas: the search bar at the top, a facet filter sidebar on the left, and the results list on the right.

search.opensolr.com/my-index Search your content... Web Media Images Filters CATEGORY Documentation (42) Blog Posts (18) API Reference (7) DATE RANGE Last 30 days AUTHOR John Doe (23) Jane Smith (15) 67 results found in 12ms IMG Getting Started with Opensolr Learn how to create your first index and start... opensolr.com/docs/getting-started IMG Configuring Search Relevancy Fine-tune your search results with boost rules... opensolr.com/docs/search-tuning IMG API Reference: /select Endpoint Complete guide to querying your Opensolr index... opensolr.com/api-reference 1 2 3 Content Tabs Facets Results

Your Search Page URL

Every index you create on Opensolr automatically gets its own public search page. The URL follows a simple pattern:

Your URL

https://search.opensolr.com/YOUR_INDEX_NAME

Replace YOUR_INDEX_NAME with the exact name of your Opensolr index. Share this link with anyone — it is public and works instantly.

Search Page Features

Your hosted search page is packed with features out of the box. No configuration needed — they all work automatically based on your index data.

Full-Text Search

Type anything in the search bar and get instant results. Opensolr searches across all text fields in your index — titles, descriptions, body content, and more.

Highlighted Results

Your search terms are automatically highlighted in the results, so users can instantly see why each result matched their query.

Faceted Sidebar

A sidebar with clickable filters lets users narrow results by category, date, author, or any field you have indexed. Facets update in real time as the user searches.

Search by Image

Visitors can search with a photo instead of words — on a phone, straight from the camera. Opensolr works out what is in the picture, or reads it when it is a label or a receipt, and your search runs on it. Nothing to set up, nothing to re-index.

abc... Autocomplete

As users type, the search bar suggests matching terms. This helps users find what they are looking for faster and reduces typos. See also: Autocomplete & Spellcheck Implementation.

tehthe Spellcheck

If a user misspells a word, Opensolr suggests the correct spelling and can automatically search for the corrected query. “Did you mean...?” Learn how to enable spellcheck in Solr.

AI Hints

An AI-generated answer appears above your search results, sourced directly from your content. It answers the user's question at a glance without clicking any result.

AI Reader

Click the “Read” button on any search result to get an AI-powered summary of the full page. Users get the key information without leaving the search page.

1 2 3 Pagination

Results are split across pages, so the search stays fast even with thousands of results. Choose numbered pages or infinite scroll (see below). For API-level pagination and sorting options, see Pagination, Sorting & Freshness Boosting.

Content Tabs

The search page organizes results into three tabs at the top. Users can switch between them to find exactly the type of content they need.

Web

Standard web page results — articles, blog posts, product pages, and any HTML content from your site.

Media

Video and audio files found on your pages. Users can preview media directly in the search results.

Images

A visual gallery of all images found on your crawled pages, displayed as a thumbnail grid.

Sorting Options

By default, results are sorted by relevance — the best matches appear first. Users can also sort by date to see the newest content first. For ecommerce indexes with a price field, price sorting is available too. For a deep dive into the underlying Solr parameters, see Search Parameters Explained.

Relevant (Default)

Results are ranked by how well they match the query — term frequency, field boosts and semantic similarity. Recency plays no part unless the visitor asks for it with the Fresh toggle described below. The best answer appears first.

31 Recent

Results are sorted by date, newest first. Perfect for news sites, blogs, or any content where freshness matters most.

$ Price (Ecommerce)

Sort by price ascending or descending. Only available if your index has a price field. Great for product catalogs and online stores.

Fresh Results Bias

Next to the sort controls there is a Fresh toggle. It is off by default. Turn it on and every result's score is multiplied by a recency curve on the document's creation_date — full weight for something published today, about half after a year — so newer documents climb the ranking.

The important part is what it does not do: it never filters. The hit count is identical either way, nothing older becomes unreachable, and a document with no date at all simply keeps its place rather than being pushed to the bottom. That is what separates it from a date filter, which removes results outright.

The choice belongs to the person searching, not to whoever set the index up: the same index answers “the most relevant thing” and “the most relevant recent thing” depending on which the visitor asks for. It travels in the URL as fresh_bias=1, so a fresh-biased search can be bookmarked and shared, and it survives paging, facet clicks and a new query typed into the box.

It works on every search shape — keyword-only, vector-only and the fused hybrid ranking — because the boost wraps the final score rather than one half of it. On the API and in the client packages the same behaviour is available as a fresh_bias parameter.

AI Search Toggle

On vector-capable indexes, an AI toggle sits next to Fresh. Its starting position mirrors the index's Search Mode from Index Settings: on for any hybrid mode, off when the index is set to Lexical Only.

The visitor can flip it either way, and their choice overrides the index setting for their own searches only — the index configuration never changes. Switched on, the search runs as full hybrid (keyword + semantic vector matching, union mode) even on a Lexical Only index. Switched off, the search runs as pure keyword matching even on a hybrid index — useful when someone wants exact, deterministic keyword results with no semantic neighbours.

The choice travels in the URL as ai=yes or ai=no, so it can be bookmarked and shared, and it survives paging, tab switches, spellcheck suggestions, facet clicks and new queries. In the embed widget the same control is available as the data-ai attribute.

Search Operators

The ? button beside the search box opens a short reference to the operators a visitor can type. They work identically with the AI toggle on and off.

OperatorWhat it doesExample
"word1 word2"Phrase — those words together, in that order"machine learning"
+wordRequired — every result must contain it+laptop 15 inch gaming
+"word1 word2"Required phrase+"13 inch"
-wordExcluded — drop any result containing itlaptop -refurbished
-"word1 word2"Excluded phrase-"open box"

They compose in one query: +laptop +"13 inch" -refurbished returns only 13-inch laptops and never a refurbished one.

Anything with + or - in front of it — a word or a phrase — becomes a filter over the whole result set, so an exclusion holds even when the semantic half of a hybrid search would otherwise have surfaced that document. An unprefixed phrase influences ranking on the keyword side instead; write +"…" when you need it enforced. Ordinary hyphenated words such as e-mail and covid-19 are searched for literally. The reasoning is on the Hybrid Search page.

Search by Image

To the left of the search box there is a small image button. Click it, pick a photo, and the search runs on what is in the picture. On a phone the same button opens the camera, so a visitor can photograph something and search for it on the spot.

Photo in, results out. There is nothing to switch on, nothing to add to your index and nothing to re-index — and everything you already set up keeps working exactly as it did: ranking, facets, filters, freshness, query elevation and your saved Search Tuning.

The words themselves stay out of the way. The search box shows a small thumbnail of the uploaded picture instead, so the visitor can see which image the results belong to; hovering enlarges it and clicking opens it full size. The query is still in the URL, so an image search can be bookmarked and shared like any other, and typing in the box replaces it with a normal text search.

Labels, receipts and documents are read, not just recognised. When the picture is mostly text — a shelf tag in a store, a spec label on a box, a receipt — Opensolr reads it and searches with the largest print on it plus any article or model number it finds, which is how a photo of a door's shelf tag lands on that exact door. Because a query like 6048297 G1-88 is something to match rather than something to understand, that search runs with the AI toggle off and the toggle switches back to the visitor's own setting on their next typed query. Under the results the page says what it read, so the visitor always knows why they got what they got.

Accepted: JPEG, PNG, WEBP, GIF, BMP, TIFF, HEIC and AVIF, up to 20 MB. The uploaded picture is never stored — it is described, then discarded. The same capability is available to your own applications through the image_to_text API endpoint.

What it looks like. Nine real searches, on live indexes — click any of them to open it full size.

Embedding Search in Your Website

You can embed the full Opensolr search experience directly into any page on your website. It takes one line of code. The embedded search widget looks and behaves exactly like the hosted page, but lives inside your site.

yourwebsite.com EMBEDDED OPENSOLR SEARCH Search... One line of embed code — full search on YOUR site

The Embed Code

Copy and paste this single line into any HTML page where you want the search widget to appear:

<script src="https://search.opensolr.com/embed/YOUR_INDEX_NAME"
data-topbar="true"
data-og="true"
data-fresh="true"
data-ui-theme="light"
data-layout="full"
data-pagination-style="numbered"
data-lang="en"
data-locale="en_US"
data-source="web"
data-sidebar="true"></script>
All attributes are optional.

The only required part is the src URL with your index name. Every data- attribute has a sensible default. Add only the ones you want to customize. For a complete end-to-end example with HTML, CSS, and JavaScript, see the Complete Search Page Example.

Embed Code Attributes

Each attribute controls a different aspect of the embedded search widget. Here is a full reference:

Attribute Values Default What It Does
data-topbar true / false true Show or hide the Opensolr branded bar at the top of the widget. Set to false for a clean, white-label look.
data-og true / false true Show Open Graph thumbnails (page images) next to each search result. Set to false for text-only results.
data-fresh true / false true Boost fresh (recently updated) content higher in results. Set to false for pure relevance ranking.
data-ui-theme light / dark light Light theme has a white background; dark theme uses navy/dark background. Choose whichever matches your site's design.
data-layout full / compact full full shows the sidebar + results. compact hides the sidebar for a narrower layout (e.g., inside a modal).
data-pagination-style numbered / infinite numbered numbered shows page 1, 2, 3 buttons. infinite loads more results as the user scrolls down (infinite scroll).
data-lang ISO code, e.g. en, de, fr en The language for UI labels (Search, Filters, No results, etc.). Affects the interface language, not the content language.
data-locale Locale code, e.g. en_US, de_DE en_US Controls number and date formatting. For example, de_DE uses comma as decimal separator and DD.MM.YYYY dates.
data-source web / media / images web Which content tab to show first when the search page loads. Users can still switch between tabs.
data-sidebar true / false true Show or hide the facet filter sidebar. Set to false if you want a clean, results-only layout.

Theme Options: Light vs Dark

The embed code supports two visual themes. Pick the one that best matches your website's look and feel.

Search...

Light Theme

data-ui-theme="light"

Search...

Dark Theme

data-ui-theme="dark"

Pagination Styles

Choose how users navigate through large result sets. Both styles work with all themes and layouts.

Page: 1 2 3 Next Users click numbered buttons to move between pages.

Numbered Pages

data-pagination-style="numbered"

More results load as user scrolls down.

Infinite Scroll

data-pagination-style="infinite"

Tips for Embedding

Place it in a wide container

The search widget works best in a container at least 700px wide. If your layout is narrower, set data-sidebar="false" and data-layout="compact" for the best experience.

Use a dedicated search page

Create a page on your website called “Search” and put the embed code there. Link to it from your navigation menu for the best user experience.

Match your site's theme

If your website has a dark background, use data-ui-theme="dark". This makes the search widget blend seamlessly into your design.

Works in any CMS

WordPress, Drupal, Joomla, Shopify, Squarespace, Wix — the embed code works anywhere you can add a <script> tag. Paste it in an HTML block and you are done.

Need more control?

For the Drupal CMS, we offer a dedicated Opensolr Search module with full admin integration, crawler management, and AI features built right into your Drupal dashboard.

Related FAQ Articles

Search Parameters Explained

Full reference for every Solr query parameter: q, fq, fl, sort, facets, and more.

Understanding the Solr JSON Response

Learn how to parse and use the JSON response returned by every Opensolr search query.

Code Examples: Build Your Own Search UI

HTML, JavaScript, and CSS code snippets you can use to build a custom search front end.

Complete Search Page Example

A full end-to-end example with working code you can copy and adapt for your project.

Related Documentation

Search Tuning

Learn how to boost fields, adjust relevance weights, and fine-tune your results ranking.

AI & Vector Search

Explore AI Hints, AI Reader, and vector-based semantic search for smarter results.

Facet Filters

Configure the sidebar filters that let users narrow down search results by category, date, and more.