Skip to content

Commit 6b46ddc

Browse files
Merge pull request #1868 from HeidiSteen/heidist-uuf
[azure search] UUF fix, update hybrid search examples plus freshness …
2 parents f9e04f0 + 1fa4235 commit 6b46ddc

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

articles/search/hybrid-search-overview.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.service: azure-ai-search
99
ms.custom:
1010
- ignite-2023
1111
ms.topic: conceptual
12-
ms.date: 10/01/2024
12+
ms.date: 12/06/2024
1313
---
1414

1515
# Hybrid search using vectors and full text in Azure AI Search
@@ -20,13 +20,13 @@ Hybrid search is a combination of full text and vector queries that execute agai
2020
+ Executing in parallel
2121
+ With merged results in the query response, scored using [Reciprocal Rank Fusion (RRF)](hybrid-search-ranking.md)
2222

23-
This article explains the concepts, benefits, and limitations of hybrid search. Watch this [embedded video](#why-choose-hybrid-search) for an explanation and short demos of how hybrid retrieval contributes to high quality chat-style and copilot apps.
23+
This article explains the concepts, benefits, and limitations of hybrid search. Links at the end provide instructions and next steps. You can also watch this [embedded video](#why-choose-hybrid-search) for an explanation of how hybrid retrieval contributes to high quality RAG apps.
2424

2525
## How does hybrid search work?
2626

27-
In Azure AI Search, vector fields containing embeddings can live alongside textual and numerical fields, allowing you to formulate hybrid queries that execute in parallel. Hybrid queries can take advantage of existing functionality like filtering, faceting, sorting, scoring profiles, and [semantic ranking](semantic-search-overview.md) in a single search request.
27+
In Azure AI Search, vector fields containing embeddings can live alongside textual and numerical fields, allowing you to formulate hybrid queries that execute in parallel. Hybrid queries can take advantage of existing text-based functionality like filtering, faceting, sorting, scoring profiles, and [semantic ranking](semantic-search-overview.md) on your text fields, while executing a similarity search against vectors, all in a single search request.
2828

29-
Hybrid search combines results from both full text and vector queries, which use different ranking functions such as BM25, HNSW, and EKNN. A [Reciprocal Rank Fusion (RRF)](hybrid-search-ranking.md) algorithm merges the results. The query response provides just one result set, using RRF to rank the unified results.
29+
Hybrid search combines results from both full text and vector queries, which use different ranking functions such as BM25 for text, and Hierarchical Navigable Small World (HNSW) and exhaustive K Nearest Neighbors (eKNN) for vectors. A [Reciprocal Rank Fusion (RRF)](hybrid-search-ranking.md) algorithm merges the results. The query response provides just one result set, using RRF to rank the unified results.
3030

3131
## Structure of a hybrid query
3232

@@ -42,19 +42,28 @@ POST https://{{searchServiceName}}.search.windows.net/indexes/hotels-vector-quic
4242
"search": "historic hotel walk to restaurants and shopping",
4343
"select": "HotelId, HotelName, Category, Description, Address/City, Address/StateProvince",
4444
"filter": "geo.distance(Location, geography'POINT(-77.03241 38.90166)') le 300",
45+
"vectorFilterMode": "postFilter",
4546
"facets": [ "Address/StateProvince"],
46-
"vectors": [
47+
"vectorQueries": [
4748
{
48-
"value": [ <array of embeddings> ]
49-
"k": 7,
50-
"fields": "DescriptionVector"
49+
"kind": "vector",
50+
"vector": [ <array of embeddings> ]
51+
"k": 50,
52+
"fields": "DescriptionVector",
53+
"exhaustive": true,
54+
"oversampling": 20
5155
},
5256
{
53-
"value": [ <array of embeddings> ]
54-
"k": 7,
55-
"fields": "Description_frVector"
57+
"kind": "vector",
58+
"vector": [ <array of embeddings> ]
59+
"k": 50,
60+
"fields": "Description_frVector",
61+
"exhaustive": false,
62+
"oversampling": 10
5663
}
5764
],
65+
"skip": 0,
66+
"top": 10,
5867
"queryType": "semantic",
5968
"queryLanguage": "en-us",
6069
"semanticConfiguration": "my-semantic-config"
@@ -64,9 +73,9 @@ POST https://{{searchServiceName}}.search.windows.net/indexes/hotels-vector-quic
6473
Key points include:
6574

6675
+ `search` specifies a single full text search query.
67-
+ `vectors` for vector queries, which can be multiple, targeting multiple vector fields. If the embedding space includes multi-lingual content, vector queries can find the match with no language analyzers or translation required.
68-
+ `select` specifies which fields to return in results, which should be text fields that are human readable.
69-
+ `filters` can specify geospatial search or other include and exclude criteria, such as whether parking is included. The geospatial query in this example finds hotels within a 300-kilometer radius of Washington D.C.
76+
+ `vectorQueries` for vector queries, which can be multiple, targeting multiple vector fields. If the embedding space includes multi-lingual content, vector queries can find the match with no language analyzers or translation required. If you're also using the semantic ranker, set `k` to 50 to maximize its inputs.
77+
+ `select` specifies which fields to return in results, which should be text fields that are human readable if you're showing them to users or sending them to an LLM.
78+
+ `filters` can specify geospatial search or other include and exclude criteria, such as whether parking is included. The geospatial query in this example finds hotels within a 300-kilometer radius of Washington D.C. You can apply the filter at the beginning or end of query processing. If you use the semantic ranker, you probably want post-filtering as the last step but you should test to confirm which behavior is best for your queries.
7079
+ `facets` can be used to compute facet buckets over results that are returned from hybrid queries.
7180
+ `queryType=semantic` invokes semantic ranker, applying machine reading comprehension to surface more relevant search results. Semantic ranking is optional. If you aren't using that feature, remove the last three lines of the hybrid query.
7281

@@ -132,4 +141,6 @@ The following video explains how hybrid retrieval gives you optimal grounding da
132141
133142
## See also
134143

135-
[Outperform vector search with hybrid retrieval and ranking (Tech blog)](https://techcommunity.microsoft.com/t5/azure-ai-services-blog/azure-cognitive-search-outperforming-vector-search-with-hybrid/ba-p/3929167)
144+
+ [Create a hybrid query](hybrid-search-how-to-query.md)
145+
+ [Relevance scoring in hybrid search](hybrid-search-ranking.md)
146+
+ [Outperform vector search with hybrid retrieval and ranking (Tech blog)](https://techcommunity.microsoft.com/t5/azure-ai-services-blog/azure-cognitive-search-outperforming-vector-search-with-hybrid/ba-p/3929167)

0 commit comments

Comments
 (0)