You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/hybrid-search-overview.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.service: azure-ai-search
9
9
ms.custom:
10
10
- ignite-2023
11
11
ms.topic: conceptual
12
-
ms.date: 10/01/2024
12
+
ms.date: 12/06/2024
13
13
---
14
14
15
15
# 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
20
20
+ Executing in parallel
21
21
+ With merged results in the query response, scored using [Reciprocal Rank Fusion (RRF)](hybrid-search-ranking.md)
22
22
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.
24
24
25
25
## How does hybrid search work?
26
26
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.
28
28
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.
30
30
31
31
## Structure of a hybrid query
32
32
@@ -42,19 +42,28 @@ POST https://{{searchServiceName}}.search.windows.net/indexes/hotels-vector-quic
42
42
"search": "historic hotel walk to restaurants and shopping",
"filter": "geo.distance(Location, geography'POINT(-77.03241 38.90166)') le 300",
45
+
"vectorFilterMode": "postFilter",
45
46
"facets": [ "Address/StateProvince"],
46
-
"vectors": [
47
+
"vectorQueries": [
47
48
{
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
51
55
},
52
56
{
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
56
63
}
57
64
],
65
+
"skip": 0,
66
+
"top": 10,
58
67
"queryType": "semantic",
59
68
"queryLanguage": "en-us",
60
69
"semanticConfiguration": "my-semantic-config"
@@ -64,9 +73,9 @@ POST https://{{searchServiceName}}.search.windows.net/indexes/hotels-vector-quic
64
73
Key points include:
65
74
66
75
+`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.
70
79
+`facets` can be used to compute facet buckets over results that are returned from hybrid queries.
71
80
+`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.
72
81
@@ -132,4 +141,6 @@ The following video explains how hybrid retrieval gives you optimal grounding da
132
141
133
142
## See also
134
143
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