Improving product searchability is essential for any commerce website. Traditional search experiences typically rely on keywords and synonyms, but they often fail to capture the user’s intent effectively. Understanding intent through keywords alone is challenging, as many words in English have multiple meanings, and their true meaning depends on the context of the entire query. To address this challenge, we can leverage vector embeddings from AI models alongside a search platform that supports vector-based retrieval, enabling intent-based search and delivering more relevant results beyond basic keyword matching.

NOTE: Sitecore Search supports semantic search ranking, which may help you achieve better results. Full Semantic Search capabilities are on Sitecore Search’s roadmap and are expected to be available in the coming months. Keep an eye on this Search changelog for updates.
In this blog, I’ll walk you through setting up Semantic Search with OrderCloud and Azure AI Search to enhance product discovery.
Create an Azure AI Search Index to index products from OrderCloud:
Navigate to the Azure Portal and create a new Azure AI Search instance. Once set up, add a new index, add required fields, and configure it with vector fields for the fields you wish to include in your Semantic Search. When defining these vector fields, you’ll be prompted to create a vector profile, which includes selecting the algorithm, vectorizer, and compression settings based on your specific needs. The vectorizer is the key built-in AI Search component that converts search query inputs into vectors during the search operation, enabling vector-based search. For a deeper understanding of the vectorization process and configurations, refer to the AI Search Vector Search Documentation.

Deploy an Azure OpenAI Embedding Model for generating vectors:
In the Azure Portal, create a new OpenAI Service. After the service is set up, navigate to Azure AI Foundry to create a new project. Within the project, deploy an embedding model that will be used to generate vectors for your vector-based search.

Create an Azure Logic App to index products along with vectors:
Build a Logic App with an HTTP trigger that generates the embeddings leveraging the above Azure OpenAI Embedding model deployment, prepares the index document, and indexes the same in Azure AI Search. Here is a guiding example screenshot and code of the Logic App with the necessary fields. Ensure to incorporate the security and error handling best practices as per your requirements.

Create the Webhook in OrderCloud to index products after updates:
Add a new Webhook in the OrderCloud portal with the Payload URL as the HTTP URL of the above Logic App and Trigger Events as POST/PATCH/PUT operations of Products API.
Test Semantic Search:
With everything wired up, you can now test the Semantic Search functionality using the Search Explorer within Azure AI Search. The example below demonstrates an intent-based search that retrieves a document, even though none of the query words appear in the indexed content. This showcases the power of semantic search in understanding the intent behind the query and matching relevant results based on context, rather than exact keyword matches.

Integrate with your application:
You may follow one of the approaches specified in Quickstart vector search – Azure AI Search | Microsoft Learn to perform Semantic Search on the above setup from your application using REST API or SDKs.
You may need to leverage the above Logic App to build workflows to handle product deletion and initial import if needed. Additionally, ensure that your solution is resilient to Azure OpenAI Service quotas and limits.
Happy Searching!