How can I create a custom search function in Cognitive search?

Mathias Opland 155 Reputation points
2023-06-20T13:51:38.7533333+00:00

Hi,

I want to combine keyword based and embedding based search, and found out that OpenAI Embeddings can be used as a custom skillset in Cognitive search to enrich the data set. My idea was to find a way to both use cognitive search word search and similarity search using OpenAI embeddings, and create a similarity score based on a weighted average.

I followed this repo to set up data enrichment of the indexes using OpenAI Embeddings: https://github.com/Azure-Samples/azure-search-power-skills/tree/main/Vector/EmbeddingGenerator, however, there is no mention of how to use the embedding vectors in a similarity search. I have not found a way to add a custom similarity search function in order to actually use the embedding vectors to perform a similarity search. Is there anything I have overlooked?

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,331 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,069 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,580 questions
0 comments No comments
{count} votes

Accepted answer
  1. Joel Borellis (gametolearn) 195 Reputation points
    2023-06-20T19:51:21.01+00:00

    If you are using Python check out the link below. There are examples of using both vector and text combined. Note the setting of search_text in the examples. If set to "" and then using the vector parameter you will do a Vector only search. If you set it to your query you can do hybrid.

    https://github.com/Azure/cognitive-search-vector-pr/blob/main/demo-python/code/azure-search-vector-python-sample.ipynb

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.