Enhancing search results with Vector Search

What is Vector Search?

Vector search functionality allows you to apply numeric values to content, enabling you to return search results based on semantic similarity rather than keyword matching. Vector search can capture the conceptual meaning of the content to identify relevant results that are linguistically distinct, for example, "dog" and "canine".

This approach elevates the quality of search outcomes compared to traditional keyword-based methods. In vector search, the system identifies the nearest match to the input query, enhancing the precision of search results. By representing the user search query, words, phrases, or documents as vectors in a high-dimensional space, SmartHub can calculate the distance between vectors to reflect their semantic similarity.

Supported Search Engines

Limitations

Note the following:

  • When vector query is included, all SmartHub functionalities that are set up or consumed in the end user UI are not guaranteed to work as expected.

  • For a list of all limitation and unavailable functionalities, see Vector Search limitations.

Vector query object model in SmartHub

Vector queries are controlled in SmartHub using the SearchQuery object, which is available for processing in Query Scripting Tuning stages. For more information on processing the query in scripting stages, see Add Scripting to Tuning Stages.

The query object model member that represents the vector queries

Copy
public IEnumerable<VectorQuery> VectorQueries
  • VectorQueries: this is the collection of the VectorQuery objects that represent all of the vector query components that will be used in the search.

The VectorQuery class

Copy
public class VectorQuery
 {
     public IEnumerable<string> Fields;
     public IEnumerable<double> Embeddings;
 }
  • Fields: These are the property fields that the vector query should be applied to (Example: body, Title, etc.).

  • Embeddings: This is the actual vector representation of the vector query (vector embedding).

Example of a Query Tuning Stage Script that Generates Vector Embedding

To see a sample script for generating vector queries using OpenAI, refer to Generate Vectors in Query Scripting Pipeline.