Embed Search

Add a fully working search box to any webpage by copying and pasting a single code snippet.

Embed Search lets you add a complete, working search box to any webpage — no development work required. You configure the search settings in the Admin Console, click Generate Embed Code, and paste the generated HTML snippet into your website. Users on your site can then search your content directly without leaving the page.

Steps to Configure Embed Search:

  1. Navigate to Embed Search Settings:
    Go to Dashboard -> Collections -> Embed Search.

  2. Select Collections:
    Choose the collections you want to include in the search.

  3. Configure Facet Filters:
    Facet Filters: Facet filters let users refine and narrow search results based on specific criteria. When configuring Embed Search in SearchBlox, you can select from various facet filters to improve the search experience.
    Common Facet Filters:

    FilterWhat It Does
    Content TypeFilters results by file type, such as PDFs, HTML pages, or Word documents
    Last ModifiedFilters documents based on how recently they were updated, such as within the last 30 days
    CollectionsFilters results to display content only from selected collections
    KeywordsFilters results using keywords or tags associated with the content
  4. Choose a Tuning Template: Relevance Tuning Templates in SearchBlox help optimize search results based on content type and user needs. These pre-configured templates ensure the most relevant results appear prominently.

i. WEB:
Best for general website content.
Gives more importance to metadata, titles, and descriptions.
Suitable for corporate sites, blogs, and informational pages.

ii. ECOMMERCE:
Designed for online shopping sites.
Boosts product names, categories, and prices.
Ideal for websites with product catalogs.

iii.NEWS:
Built for news and media content.
Highlights newer articles and trending topics.
Perfect for news portals and media websites.

iv.KNOWLEDGE_BASE:
Optimized for documentation and help articles.
Boosts content based on relevance, popularity, and recent updates.
Great for support portals or internal knowledge bases.

v.FAQ:
Made for frequently asked questions.
Prioritizes short answers and common search terms.
Ideal for customer support or help center pages.

  1. Select a Search Template:
    Select a UI Template: Choose a UI template such as Web, Ecommerce, or Database that matches the look and feel of your website or application. This template controls how the search interface appears and behaves so it blends well with your site design.
  2. Enabling Auto-Suggest in the Search Box: Auto-suggest displays instant suggestions as users start typing in the search box, helping them find information faster and reducing typing effort. This feature can be enabled and configured in the Embed Search settings.
  3. Enabling SmartSuggest in the Search Box: SmartSuggest provides real-time suggestions while users type their queries in the search box, improving the search experience by helping users find results quickly with fewer keystrokes.\

Difference at a glance:

FeatureHow It WorksBest For
Auto-SuggestMatches text from titles, search queries, or indexed contentGeneral search suggestions
SmartSuggestUses AI to predict user intent based on site contextSmarter and more accurate search suggestions

Enable SmartSuggest, by default disabled. Choose Name and Limit from the drop-down list. To know more about SmartSuggest, Click here


  1. Generate Embed Code:
    Click Generate Embed Code to create the HTML snippet needed to embed the search component.
  2. Place the Embed Code:
    Copy the generated HTML code and insert it between the header () and footer () sections of your HTML page.

🚧

NOTE:

  • If you need to use the widget code outside the SearchBlox server, add the following line to the generated widget code:
    <input type="hidden" id="sb_plugin_domain" value="https://domain.com"/>
  • Replace domain.com with your domain name.