Ctrl+K
Squirro Documentation - Home

Overview

  • Getting Started
  • Squirro Products
    • Chat
    • Search
    • Insight Engine

Getting Squirro

  • Installation and Upgrade
    • Install and Manage Squirro with Ansible
      • Ansible Quickstart Examples
      • Role Variables
      • Automate the Backup of Elasticsearch
      • Secure Elasticsearch with SSL/TLS
      • Leveraging NVMe SSDs for Elasticsearch speed
    • Deploying Squirro using Containers
      • Squirro Minimal Container Image
      • Container Reference
    • Cluster Expansion
    • Elasticsearch Migration
    • Installing Squirro on Linux
    • System Requirements
    • Upgrading
    • Upgrading Configuration Conflicts
    • Upgrading Earlier Versions
  • Squirro Self-Service
    • How-To Guides
      • Squirro Chat Data Guide
      • Squirro Chat Web Guide
      • How to Connect Squirro Chat to a Third-Party LLM
      • How to Connect Squirro Chat to a Microsoft Azure LLM
      • Install an Application
      • Open a Demo
      • Launch a Test Drive
      • Register for a Squirro ID
    • Cluster Roles and Permissions
    • Email Domain-Based Permissions
    • Instances
    • Upgrading an Instance
  • Release Notes
    • 3.13.2 (latest)
      • 3.13.0 Release Notes
      • 3.13.1 Release Notes
    • 3.12.1 LTS
    • 3.11.6 LTS
      • Squirro 3.11.x Release Notes
        • 3.11.5 Release Notes
        • 3.11.4 Release Notes
        • 3.11.3 Release Notes
        • 3.11.2 Release Notes
        • 3.11.1 Release Notes
        • 3.11.0 Release Notes
    • 3.10.6 LTS
      • Squirro 3.10.x Release Notes
        • 3.10.0 - Release Notes
        • 3.10.1 - Release Notes
        • 3.10.2 - Release Notes
        • 3.10.3 - Release Notes
        • 3.10.4 - Release Notes
        • 3.10.5 - Release Notes
    • 3.9.7 LTS
      • 3.9.7 LTS Release Notes
      • SquirroGPT Release Highlights
      • Squirro 3.9.x Release Notes
        • 3.9.0 Release Notes
        • 3.9.1 Release Notes
        • 3.9.2 Release Notes
        • 3.9.3 Release Notes
        • 3.9.4 Release Notes
        • 3.9.5 Release Notes
    • 3.8.7 LTS
      • 3.8.7 LTS Release Notes
      • 3.8.6 LTS Release Notes
      • Squirro 3.8.x Release Notes
        • 3.8.0 - Release Notes
        • 3.8.1 - Release Notes
        • 3.8.2 - Release Notes
        • 3.8.3 - Release Notes
        • 3.8.4 - Release Notes
        • 3.8.5 - Release Notes
    • 3.7.6 LTS
      • 3.7.6 LTS - Release Notes
      • 3.7.5 LTS Release Notes
      • Squirro 3.7.x Release Notes
        • 3.7.1 - Release Notes
        • 3.7.2 - Release Notes
        • 3.7.3 - Release Notes
        • 3.7.4 - Release Notes
    • 3.6.8 LTS
      • 3.6.8 LTS Release Notes
      • Squirro 3.6.8 LTS - Cognitive Search Improvements
      • Squirro 3.6.x Release Notes
        • 3.6.0 - Release Notes
        • 3.6.1 - Release Notes
        • 3.6.2 - Release Notes
        • 3.6.3 - Release Notes
        • 3.6.4 - Release Notes
        • 3.6.5 - Release Notes
        • 3.6.6 - Release Notes
    • 3.5.8 LTS
      • 3.5.8 LTS Release Notes
      • 3.5.8 LTS - Cognitive Search Improvements
      • 3.5.9 LTS - Release Notes
      • 3.5.x Release Notes
        • 3.5.7 Release Notes
        • 3.5.6 Release Notes
        • 3.5.5 Release Notes
        • 3.5.4 Release Notes
        • 3.5.3 Release Notes
        • 3.5.2 Release Notes
        • 3.5.1 Release Notes
        • 3.5.0 Release Notes
    • 3.4.7 LTS
      • 3.4.7 LTS Release Notes
        • 3.4.X Release Notes
      • 3.4.X Release Notes
        • 3.4.0 Release Notes
        • 3.4.1 Release Notes
        • 3.4.2 Release Notes
        • 3.4.3 Release Notes
        • 3.4.4 Release Notes
        • 3.4.5 Release Notes
        • 3.4.6 Release Notes
    • Squirro Release Process

Technical Docs

  • Administration
    • Configuration
      • Configuration Files
        • cluster.ini
        • common.ini
        • configuration.ini
        • convert.ini
        • datasource.ini
        • digestmailer.ini
        • emailsender.ini
        • filtering.ini
        • fingerprint.ini
        • frontend.ini
        • genai.ini
        • ingester.ini
        • topic.ini
        • /etc/sysconfig
      • Configuration Service
      • Default Language
      • Email Templates
      • Enable Proxy Server for Outgoing Calls
      • High Performance Configuration
      • Interpolation
      • Securing Configuration Files
      • Secure Configuration Guide
      • Securing Redis Instance over SSL
      • SSL Certificates
    • External Authentication
      • Architecture for Authentication
      • Query Templates
      • User Management in the UI
      • SAML SSO for Squirro
      • - ADFS Setup
      • - Azure Setup
      • - Google Setup
      • - Okta Setup
    • Operations
      • Accessing Servers
      • Activity Tracking
      • Business Continuity Planning
      • Cluster Status
      • Database Backup and Restore
      • Reindexing Elasticsearch
      • Elasticsearch Management
      • Fixing MySQL/MariaDB Replication
      • How Squirro Scales
      • Monitoring
      • Services
      • How to Set Up Oracle Database as Squirro’s Metadata Storage
      • Deploying the Plumber service in a Docker container
    • Troubleshooting
      • Internet Explorer Compatibility
      • Investigating Performance Issues
      • MySQL Big Data Management
      • MySQL Too Many Connections
      • Flushing Caches
      • Python Performance Profiling Using PySpy
  • Agent Framework
  • AI Guardrails
  • AI Studio
    • How-To Guides
      • Bulk Labeling
      • Create Document-Level Models
      • Create Sentence-Level Models
      • Integrating a Custom ML Classifier
      • Interact with Squirro Using Jupyter Notebook
    • Step 1: Ground Truth
    • Step 2: Models
    • Step 3: Publish and Deploy
    • Share Labeling Permissions
    • Bulk Labeling
    • ML Enrichments for Pipeline Workflows
    • Squirro Client Reference
  • APIs and SDKs
    • SquirroClient (Python SDK)
      • APIs by Topic
        • CollectionsMixin
        • CommunitiesMixin
        • CommunitySubscriptionsMixin
        • CommunityTypesMixin
        • ConfigurationMixin
        • ContributingRecordsMixin
        • DashboardsMixin
        • EmailTemplatesMixin
        • EnrichmentsMixin
        • EntitiesMixin
        • FacetsMixin
        • FileUploadMixin
        • GlobalTempMixin
        • MLCandidateSetMixin
        • MLGroundTruthMixin
        • MLModelsMixin
        • MLPublishMixin
        • MLSentenceSplitterMixin
        • MLTemplatesMixin
        • MLUserFeedbackMixin
        • MachineLearningMixin
        • NotesMixin
        • ObjectsMixin
        • PipelineSectionsMixin
        • PipelineStatusMixin
        • PipelineWorkflowMixin
        • ProjectGuideFilesMixin
        • ProjectTranslationsMixin
        • ProjectsMixin
        • SavedSearchesMixin
        • SmartAnswersMixin
        • SmartfiltersMixin
        • SourcesMixin
        • SubscriptionsMixin
        • SuggestImageMixin
        • SynonymsMixin
        • TasksMixin
        • ThemesMixin
        • TopicApiBaseMixin
        • TrendDetectionMixin
        • WidgetsAndAssetsMixin
      • DocumentUploader Class
      • GenAI service API
        • GenAIApiMixin
      • Installation
      • ItemUploader Class
      • Setup Class
      • SquirroClient Tutorial
      • User Management
        • UserApiMixin
    • Squirro Toolbox
      • Bulk Exporter
      • Install In a Python Environment
      • squirro_asset CLI Reference
      • Toolbox Differences Between macOS / Linux / Windows
    • Authentication
    • Catalyst Data Model
    • Common Headers
    • Common Status Codes
    • Data Modeling
    • Item Format
    • JavaScript SDK
    • Plugin Repository
    • Custom Sections API
  • Architecture
    • Architecture Diagrams
    • General Concepts
  • Collections
  • Communities
    • Augmentation
    • Auto-Subscription
    • Communities Tutorial
    • CSV and Excel Formatting for Upload
    • Managing Communities
    • Setting Up Community Types
    • How To Set Up Using KEE
    • Visualizing Communities
  • Dashboards
    • Dashboard Editor
    • Dashboard Store
    • Dashboard Types
      • Community 360 Dashboard
      • Explore Dashboard
      • Global Search Dashboard
      • Layout Master Dashboard
    • Layers
    • Mobile Dashboard Editor
    • Permissions
    • Query Parameterization
    • Upgrading Dashboards Manually
    • Visibility Conditions
  • Data Loading
    • How-To Guides
      • CLI Tool Tutorial
      • Creating a Custom Connector
      • Creating a Custom Plugin
      • Labels Tutorial
      • UI Data Loading Guide
    • Command Line Tool
    • Connectors
      • Built-In Data Connectors
        • CSV Connector
        • Documents Connector
        • Excel Connector
        • Squirro Connector
        • Web Crawler Connector
      • Cloud Connectors
        • Dropbox Connector
        • Google Drive Connector
        • Microsoft One Drive Connector
      • Enterprise Connectors
        • Atlassian Confluence Connector
        • Atlassian Jira Connector
        • Google Gmail Connector
        • Microsoft Exchange Connector
        • Microsoft Sharepoint Connector
        • Salesforce Sales Cloud Connector
        • Salesforce Service Cloud Connector
        • Webz.io Connector
    • Data Types
    • Date Format
    • Data Loader Reference
    • Format Strings
    • Labels
    • Plugins
      • API for Caching and Custom State Management
      • Boilerplate
      • Configuration
      • DataSource Class Reference
      • Dependencies
      • Example Data Loader Plugin
      • Incremental Loading
      • Preview
      • Templates
    • Troubleshooting
    • UI Data Loader
  • Data Processing Pipeline
    • Built-In Steps
      • Load
      • Enrich Steps
        • Unshorten Link
        • Duplicate Detection
        • Content Augmentation
        • Content Extraction
        • PDF OCR
        • Noise Removal
        • Near Duplicate Detection
        • Thumbnail Extraction
        • Language Detection
        • PDF Conversion
      • Relate
      • Discover
      • Classify
      • Predict
      • Recommend
      • Automate
      • Index Steps
        • Content Standardization
        • Cache Cleaning
        • Indexing
        • Search Tagging and Alerting
      • Flow
    • Custom Steps
      • Pipelets (Custom Step)
      • Squirro Scripts
    • Indexing Common Formats
    • Content Streamers
    • Pipeline Editor
    • Pipeline Overview
    • Prioritization
    • Processing Errors
    • Reset Project
    • Reruns
    • Trend Detection
  • Data Virtualization
  • Integrations
    • Atlassian (Confluence & Jira)
    • Embedding Dashboards
    • Microsoft Dynamics, Sharepoint, and Office
    • Newsletters
    • OpenSearch API
    • PegaSystems - Pega
    • Outlook
    • Qlik Sense
    • Salesforce
    • ServiceNow Insights
    • Tableau
    • Installation Guides
      • Squirro for Salesforce Installation
      • Salesforce Federated Search Installation
      • Microsoft Outlook Installation
  • Known Entity Extraction
    • Command Line Tool
    • Command Line Tool Tutorial
    • Configuration
    • Studio Plugin
    • Studio Plugin Tutorial
    • Testing
    • Tokenizers and Filters
  • libNLP
    • Base Types
    • How to Create Custom Query-Processing Steps
    • Query Processing
      • CustomSpacyNormalizer
      • IntentDetector
      • LanguageDetection
      • LemmaExpander
      • POSBooster
      • QueryClassifier
      • QueryModifier
      • QuerySyntaxParser
      • QueryZeroShotClassifier
      • SemanticTermExpander
    • Step Types
      • Standard Types
      • Analyzers Package
        • make_analyzer
        • Analyzer
        • ProximityValidation
      • Classifiers Package
        • make_classifier
        • AutoMLClassifier
        • BERTSentiment
        • Classifier
        • CosineSimilarityClassifier
        • FastTextClassifier
        • KFoldValidation
        • SklearnClassifier
        • SmartfilterClassifier
        • VaderSentiment
      • Debuggers Package
        • make_debugger
        • Debugger
        • LogFieldsDebugger
      • Embedders Package
        • make_embedder
        • BowEmbedder
        • Embedder
        • SklearnTFIDFEmbedder
        • TermsExtractionEmbedder
        • TransformerEmbedder
      • External Package
        • make_step
        • EndpointStep
        • MlflowMaasEndpointStep
        • RemoteQuestionAnswering
        • RemoteSpacy
      • Filters Package
        • make_filter
        • AggregateFilter
        • BlacklistFilter
        • CoalesceFilter
        • CopyFilter
        • DocJoinFilter
        • DocSplitFilter
        • EmptyFilter
        • Filter
        • JoinFilter
        • MergeFilter
        • ProximityFilter
        • RegexFilter
        • SplitFilter
        • SquirroEntityFilter
        • ThresholdFilter
        • VoteFilter
        • WhitelistFilter
      • Flow Package
        • make_flow_step
        • ConditionStep
      • Loaders Package
        • make_loader
        • CSVLoader
        • FileLoader
        • JSONLoader
        • Loader
        • SquirroGroundtruthLoader
        • SquirroItemLoader
        • SquirroQueryLoader
      • Normalizers Package
        • make_normalizer
        • CharacterNormalizer
        • EmailParseNormalizer
        • HTMLNormalizer
        • LowercaseNormalizer
        • Normalizer
        • PunctuationNormalizer
        • SentimentTermNormalizer
        • SpacyNormalizer
        • StopwordsNormalizer
      • Projectors Package
        • make_projector
        • Projector
        • SklearnProjector
      • Runtimes Package
        • make_runtime_step
        • ONNXRuntime
        • Runtime
      • Savers Package
        • make_saver
        • CSVSaver
        • JSONSaver
        • Saver
        • SquirroEntityCleaner
        • SquirroItemSaver
      • Tokenizers Package
        • make_tokenizer
        • HtmlTokenizer
        • PdfSentencesTokenizer
        • SentencesNLTKTokenizer
        • SpacesTokenizer
        • Tokenizer
    • Troubleshooting & FAQ
    • Utils
      • Standard Types
      • Cache Package
        • get_model_cache_client
        • Cache
        • CacheWithExpiration
        • ExpiringCache
        • MemoryCache
        • ModelCacheClient
      • Model Management Package
        • InMemModel
        • ModelNotInMemoryException
      • Transformers Package
        • get_transformer
        • Huggingface_Transformers
        • SentenceTransformer
        • Tensorflow_Transformer
        • Transformer
  • Machine Learning
    • Example MLFlow Model
    • How To Publish ML Models Using the Squirro Client
    • Model-as-a-Service
    • Significant Terms Extraction
  • Pipelets
    • How-To Guides
      • Pipelets Tutorial
      • How to Access File Contents in Pipelets
      • How to Use Pipelets With the Squirro Data Loader
    • Additional Labeling Pipelet
    • Development Workflow
    • Pipelets and the Dataloader
    • Pipelets Reference
    • Rerunning a Pipelet
    • Scaling Pipelet Execution
    • Time Formats Pipelet
    • Troubleshooting and FAQ
    • Writing Pipelets
  • Privacy Layer
  • Project Templates
    • Configuration
    • Export and Import
    • Overview
  • Retrieval Augmented Generation
  • Search
    • Features
      • Concept Search
      • Other People Ask
      • Popular Query Suggestions
      • Question Answering
      • Query Syntax
      • Search Bar Chips
      • Semantic and Hybrid Search
      • Spellchecking
      • Typeahead Suggestions
      • Favorite Filters
    • How-To Guides
      • Best-Bets Labels
      • Cognitive Search Set Up
      • Configure Other People Ask
      • Configure Question Answering
      • Configure Scoring Profiles for Document Relevancy
      • Handle Query Terms
    • Language Support
    • Document Relevancy
      • Scoring Profiles and Roles
      • Scoring Plugins
        • Recommend
        • Rerank
        • Retrieve
        • View
    • Query Processing
    • Recommendations
    • Searchable File Types
    • Synonyms
  • Synaptica
  • User Interface
    • App and Nav Bar Styling
    • Connecting to Squirro
    • Note Taking
    • Overview
    • Project Browser
    • Reference Screen
    • Roles & Permissions
    • Spaces
    • Squirro Monitoring
    • Studio
      • ML Workflows
      • ML Jobs
    • Themes
  • Widgets
    • Built-In Widgets
      • Action Widget
      • Bar Chart Widget
      • Batch Q&A
      • Breadcrumbs Widget
      • Chat Widget
      • Communities Widget
      • Communities Banner Widget
      • Divider Widget
      • Engagement Map Widget
      • Entities Widget
      • Favorites Widget
      • Heat Map Widget
      • HTML Editor Widget
      • iFrame Widget
      • Item Detail Widget
      • Items Table Widget
      • Items Widget
      • Labels Widget
      • Line Chart Widget
      • Metrics Widget
      • Navigation Chips Widget
      • Pie Chart Widget
      • QA Widget
      • Region Map Widget
      • Reset Filters Widget
      • Rich Text Editor Widget
      • Search Bar Widget
      • Spelling Correction Widget
      • Table Widget
      • Tabs Widget
      • Time Selection Widget
      • Timeline Widget
      • Word Cloud Widget
      • World Map Widget
    • Custom Widgets
    • How to Create a Custom Widget
    • Managing Widgets in the UI
    • Squirro Widget SDK
      • Core Widgets
      • Properties
      • Factories
      • Utils
    • React Custom Widgets
      • How-Tos and Walkthroughs
        • How To Opt In To React Widgets
        • How To Style React Widgets
        • Items Widget Styling Walkthrough
        • Adding Tooltips to Tabs Widget Walkthrough
      • Available React Hooks
      • Available Libraries
      • Creating Custom Widgets
      • Customizing Widgets
      • Getting Started with React
      • Squirro Storybook
      • Styling React Components
    • Backbone Custom Widgets
      • Custom Widgets Life Cycle
      • Custom Widgets for Dashboards
      • Squirro Widget CLI Reference
      • Custom Widgets and the Dashboard Store
      • Example Card or Result List Custom Widget
      • Tutorials
        • Getting Started
        • Accessing Data
      • Common Knowledge
        • FAQ
        • Debugging
        • Models, Views, & Collections
        • JavaScript
  • Workspaces

Engage

  • Forum
  • Support
  • Redefining AI Podcast

Other

  • Security
    • Security Advisories
      • CVE-2021-27945 - Cross-Site Scripting
      • CVE-2021-44228 - log4j Security Vulnerability
  • Squirro Profiles
    • System Administrator/DevOps Engineer
    • Project Creator
    • Data Scientist
    • Model Creator
    • Search Engineer
    • Python Engineer
    • Frontend Developer
    • Cognitive Search User
  • Squirro A to Z
    • Squirro Glossary
    • Glossary of Industry Terms
    • Index
  • squirro.com
  • Squirro Academy
  • Terms & Conditions

Semantic and Hybrid Search

Contents

  • Feature Availability
  • Overview
    • Advantages and Disadvantages
  • How to Add Semantic or Hybrid Search to a Project
    • Create Semantic Search Pipeline
    • Add Semantic Scoring Profile to Dashboard Query
  • Using Semantic Search
  • Disabling Semantic Search
  • Hardware Requirements
    • Storage
      • Example Calculations
      • Storing Embeddings as Bytes Instead of Floating Points
    • Memory
      • Example Calculations
      • Incorporating a Buffer for Other RAM Needs
      • Storing Embeddings as Bytes Instead of Floating Points
    • Using GPU for Paragraph Embeddings
      • Efficiency Comparison
  • Frequently Asked Questions / Troubleshooting

Semantic and Hybrid Search#

Profiles: Project Creator, Search User

Semantic search is a search technique that uses natural language processing (NLP) to understand the intent behind a query and the context in which it is being used.

Hybrid search is a combination of semantic search and traditional keyword-based search, or other scoring profiles.

This page explains the semantic search feature within Squirro, and how the semantic scoring profile is used, and discusses how Squirro Cognitive Search combines semantic search with keyword search to provide hybrid search to end users.

Feature Availability#

Semantic search is not available on any Squirro project created on a release version earlier than 3.8.4. To use this feature, you must upgrade your project to Squirro 3.8.4 or later.

Warning

Semantic search relies on the use of paragraph embeddings, which require access to a model. If you are using a Squirro Self-Service project, this is pre-configured. If you are using a Cognitive Search template on a private cloud or local installation, contact Squirro Support for assistance. In the interim, you may want to disable semantic search within your Cognitive Search project. To do so, see the Disabling Semantic Search section later on this page.

Overview#

Squirro semantic search goes beyond traditional keyword-based search and considers the meaning of the words used in the query.

In semantic search, Squirro retrieves results based on semantic/vector processes. This feature operates by using the scoring profile semantic, allowing users to perform approximate vector searches on paragraph embeddings.

For hybrid search, Squirro retrieves results based on semantic/vector processes, keywords, and potentially other scoring profiles as well.

It’s important to understand that while semantic search is a specific concept, hybrid search is a general term that can be used to describe any combination of search techniques. Within Squirro, hybrid search will typically include both semantic and keyword searches, but is not limited to those two alone. Other scoring profiles can be included, or other scoring profile combinations used.

Reference: Learn more about Scoring Profiles.

Important

All new Squirro Cognitive Search projects released on or after Squirro 3.8.6 LTS include hybrid search as the default search type.

Advantages and Disadvantages#

Semantic search is a powerful tool that can be used to find relevant results that may not contain the exact keywords used in the query.

Generally speaking, semantic search is smarter, more powerful, and more nuanced search.

However, semantic search is not the best fit for all use cases, and it is important to understand the disadvantages of the feature before enabling it.

The disadvantages of enabling semantic search within a project include:

  • Longer indexing time.

  • Higher storage requirements (given that documents must be broken down into paragraph embeddings which are stored separately). See the Hardware Requirements section later on this page.

  • Slower search speed (given that the semantic search process is more computationally intensive than keyword-based search).

If you have a project where traditional keyword search will suffice, or where speed of search is paramount, you may want to consider replacing the default hybrid search with keyword search.

How to Add Semantic or Hybrid Search to a Project#

The semantic and hybrid search is enabled by default within all new Squirro Cognitive Search projects released on or after Squirro 3.8.6 LTS. Some other projects may require you to enable the feature manually.

To enable semantic or hybrid search on a project, you must perform the following two steps:

  1. Create the Semantic Search pipeline and use it to ingest project documents.

  2. Add the semantic scoring profile to the dashboard query where you want to use semantic or hybrid search.

Create Semantic Search Pipeline#

The first step in enabling semantic or hybrid search is to create the Semantic Search pipeline and use it to ingest project documents.

To do this, follow the steps below:

  1. Open your project and navigate to the Setup space.

  2. Open the Pipeline tab.

  3. Click the Edit orange icon in the top right of the page.

  4. In the bottom left choose New Pipeline to create a new pipeline.

  5. Choose the Semantic Search workflow from the list.

  6. Provide a new name for the newly created workflow.

  7. Click the Save button in the top right of the page and exit.

  8. Use the created pipeline to ingest project documents.

Caution

Any documents not ingested using the Semantic Search pipeline will not be included in semantic search.

Note

The Semantic Search pipeline is available starting from Squirro version 3.9.1. For earlier releases, add the Paragraph Embedder step to the existing pipeline in order to use semantic search.

Add Semantic Scoring Profile to Dashboard Query#

The second step in enabling semantic search is to add the semantic scoring profile to the dashboard query where you want to use semantic search.

To do this, follow the steps below:

  1. Open your project and navigate to the Setup space.

  2. Open the Visualization tab. (This will open a list of all dashboards in the project.)

  3. Hover over the dashboard you want to enable semantic search within, click the three dots menu, and click Edit.

  4. Identify the widget you want to enable semantic search within. (It will likely be an Items widget.)

  5. Add the semantic scoring profile to the widget’s query using syntax. The example below is the syntax used in the default Cognitive Search Global Search dashboard Items widget:

<%=
queryContext?.parse?.type === 'question_or_statement'
    ? 'profile:{semantic} profile:{cross-encoder} profile:{extractive-qa}'
    : ''
%>

Note

This syntax checks if the provided query is the question or statement and, depending on the query, applies three scoring profiles: Semantic Search, Cross Encoding, and Question Answering.

Reference: To learn more about editing dashboards, see the Dashboard Editor documentation.

Using Semantic Search#

Once semantic or hybrid search has been enabled on a project, users should be encouraged to use natural language within their search queries, including phrasing queries as questions.

Below is an example of two widgets showing search results, where one shows semantic hybrid results and the other shows traditional keyword results.

The natural language query asks what is the film Public Housing about, as shown in the example screenshot below:

Example Query

The semantic hybrid search results provide a direct answer as the first result. Part of the semantic hybrid search feature is its ability to highlight what it believes to be a possible answer when it detects the search query was formed as a question.

In the example above, you can see that it gives an exact description of the film.

The simple keyword search results, on the other hand, are not as relevant to the query.

Disabling Semantic Search#

If you would like to remove semantic (hybrid) search from your Cognitive Search project, you will need to perform the following steps:

  1. Change your ingestion pipeline not to use the Semantic Search pipeline to ingest documents.

  2. Remove the semantic scoring profile from any dashboard queries where it is used.

Hardware Requirements#

The hardware requirements for semantic search depend on multiple factors, such as the number of documents, the number of paragraphs within each document, the model used to compute embeddings, and more.

It can be challenging to specify exact requirements that must be met.

However, to provide a general understanding, we can make some rough approximations.

Assumptions:

  • 8 million documents

  • Each document contains 10 paragraphs

  • Embedding contains 384 dimensions

  • The data type of the embedding is float (4 bytes)

Tip

For automated calculations of the required infrastructure, check out the Semantic Search Requirements Estimation.

Storage#

Semantic search necessitates additional storage space to store embeddings.

You can compute the required storage for a single embedding field using the following equation:

\[\text{number of bytes per dimension} \times \text{number of dimensions}\]

Example Calculations#

Considering the provided information, the embedding will occupy:

\[4 \, \text{B} \times 384 = 1536 \, \text{B}\]

In addition to the embedding, a document may have other fields and metadata.

For simplicity, let’s assume that the average combined size of a paragraph’s text and its metadata is 500 bytes.

With that in mind, the total storage required for all documents would be:

\[80,000,000 \times (1536 \, \text{B} + 500 \, \text{B}) = 162,880,000,000 \, \text{B} \approx 152 \, \text{GiB}\]

This means that, based on the provided assumptions, you would need a minimum of 152 GiB of storage to implement semantic search.

Storing Embeddings as Bytes Instead of Floating Points#

To reduce the required storage, you can consider storing the embedding as bytes instead of floating points.

In that case, the single embedding field size would be equal to the number of dimensions, and the final equation would be:

\[80,000,000 \times (384 \, \text{B} + 500 \, \text{B}) = 70,720,000,000 \, \text{B} \approx 66 \, \text{GiB}\]

Memory#

To achieve efficient queries, all vector data must be held in memory.

You should ensure that data nodes have enough RAM to accommodate the vector data and index structures.

As a general rule, the number of bytes required can be calculated as follows:

\[\text{num vectors} \times \text{number of bytes per dimension} \times (\text{num dimensions} + 12)\]

Example Calculations#

Substituting the values from the assumption, the equation would be:

\[80,000,000 \times 4 \, \text{B} \times (384 + 12) = 126,720,000,000 \, \text{B} \approx 118 \, \text{GiB}\]

This means that to use semantic search for such a project, you would need at least 118 GiB of RAM.

Incorporating a Buffer for Other RAM Needs#

The data nodes should also leave a buffer for other ways in which RAM is needed.

For example, your index might also include text fields and numerics, which benefit from using the filesystem cache.

Storing Embeddings as Bytes Instead of Floating Points#

You can reduce the required RAM, by storing the embeddings as bytes.

In that case, the required memory would be closer to:

\[80,000,000 \times (384 + 12) \, \text{B} = 31,680,000,000 \, \text{B} \approx 30 \, \text{GiB}\]

Note

Remember that these are rough estimates, and the actual hardware requirements may vary depending on factors like Elasticsearch’s internal indexing overhead, field mappings, and other settings in your Elasticsearch cluster.

Using GPU for Paragraph Embeddings#

In large-scale projects with substantial amounts of data, leveraging GPU (Graphics Processing Unit) for generating semantic search embeddings becomes imperative.

Compared to CPU (Central Processing Unit) processing, GPU acceleration significantly enhances the efficiency of generating embeddings.

Efficiency Comparison#

To highlight the significant difference in processing time between CPU and GPU, consider processing a batch of 10 paragraphs, each comprising roughly 500 tokens:

CPU Processing Time: When utilizing the CPU for this task, each batch takes around 3.8 seconds to complete the embedding generation process.

GPU Processing Time: The same batch of sentences takes approximately 0.1 seconds to generate embeddings when processed using GPU.

Note

The experiment was conducted on a server equipped with 1 Nvidia Tesla T4 GPU with 16GB GDDR6 memory. The server also featured 4 CPUs and 16GB of RAM.

Now, for further context, if we were to compute embeddings for 8 million documents, each containing 10 paragraphs:

CPU: It would take approximately 352 days to complete the computation.

GPU: In contrast, the GPU would accomplish the task in just 9 days.

Note

Provided time results consider only embeddings computation process. In real-world applications, additional factors contribute to overhead, such as network latency and other variables.

Frequently Asked Questions / Troubleshooting#

Where is the calculation of the embeddings done?

The calculation of embeddings is carried out by specialized embedding models, which operate as distinct services.

These services are engineered to function autonomously within diverse environments and are accessible by Squirro for embedding computation.

To customize the connection to these embedding services, navigate to the Server → Configuration section and make the necessary adjustments to the topic.nlp.remote-services-connection settings.

Can I switch the models used to calculate the embeddings?

Yes, the invoked model to calculate embeddings can be changed for both the data ingestion and query phases.

The model for ingesting documents can be changed in the Paragraph Embedding step within the pipeline.

Additionally, for query embeddings, you have the flexibility to specify a different worker value in the semantic scoring profile.

What search algorithm is used to perform semantic search, and what is its complexity?

The search system employs the HNSW algorithm for approximate k-nearest neighbor search, which exhibits a logarithmic scalability with a time complexity of \(O(\log N)\) in relation to the number of embeddings.

How many embeddings are created per one document?

The process of generating embeddings for a single document involves creating multiple embeddings.

This is achieved by dividing the document into smaller fragments, and then an embedding is computed for each of these fragments.

By default, the document is split at the paragraph level.

However, various chunking approaches can be configured in the Text Chunking step within the pipeline.

Can I perform only keyword search without semantic search on a project that uses hybrid search?

The search behavior is completely customizable using the query syntax, allowing for different search approaches.

You can choose to employ keyword search exclusively, semantic search exclusively, or a hybrid of both.

For instance, one dashboard widget could utilize hybrid search, while another might opt for solely keyword search.

How do the scores are combined from different queries when doing hybrid search?

When performing hybrid search, the results from both keyword search and semantic search are merged using a disjunction.

Each document’s score is determined by adding the scores from both types of queries.

Moreover, it’s possible to fine-tune the weighting of each query’s score, enabling you to prioritize one query type over the other based on your preferences.

Contents
  • Feature Availability
  • Overview
    • Advantages and Disadvantages
  • How to Add Semantic or Hybrid Search to a Project
    • Create Semantic Search Pipeline
    • Add Semantic Scoring Profile to Dashboard Query
  • Using Semantic Search
  • Disabling Semantic Search
  • Hardware Requirements
    • Storage
      • Example Calculations
      • Storing Embeddings as Bytes Instead of Floating Points
    • Memory
      • Example Calculations
      • Incorporating a Buffer for Other RAM Needs
      • Storing Embeddings as Bytes Instead of Floating Points
    • Using GPU for Paragraph Embeddings
      • Efficiency Comparison
  • Frequently Asked Questions / Troubleshooting

By Squirro AG

© Copyright 2025, Squirro AG.

Last updated on Jun 19, 2024.