Azure / azure-search-vector-samples

A repository of code samples for Vector search capabilities in Azure AI Search.
https://azure.microsoft.com/products/search
MIT License
735 stars 311 forks source link

How to determine using which searching mechanism result is coming. #38

Closed tishirsingh closed 1 year ago

tishirsingh commented 1 year ago

Hi Farzad/Team,

I have created a index which have vector and semantic configuration both using an API POST call, But while I make a query search call to index we are using semantic config search not vector, If you see below query_type = semantic. But I can see there is a difference in the response when we use index with just semantic config with when we use index with vector and semantic config(Again as mentioned above not using vector while making a search call).

could you please help me understanding when we are using index which has vector and semantic search and while making a search call to index we are just using semantic query type(Please see below code), Does result will be different and automatically vector will be used at the backend?

r = self.search_client.search(q, filter=filter, query_type=QueryType.SEMANTIC, query_language="en-us", query_speller="lexicon", semantic_configuration_name="default", top=top, query_caption="extractive|highlight-false" if use_semantic_captions else None)

farzad528 commented 1 year ago

Hi Tishir. Please note that Vector search and Semantic search are two separate features. "Semantic search" is a premium add-on feature in Azure Cognitive Search that serves as a re-ranker of the top 50 retrieved documents from either BM25 (keyword search), Vector search, or Hybrid search (BM25 + Vector). The Semantic search re-ranker uses deep neural network models from Microsoft Bing to re-rank results retrieved by the search engine, increasing the ranking of results. When using Semantic search, you also get features such as answers, captions, and highlights in your search results. See https://learn.microsoft.com/en-us/azure/search/semantic-search-overview

Based on the query above, you are only using Semantic search without any Vectors. You can take advantage of this premium add add-on feature if you find that it gives you good relevance and ranking without the use of vectorizing your corpus and queries.