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-how-to-query.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Hybrid query how-to
2
+
title: Hybrid query
3
3
titleSuffix: Azure AI Search
4
4
description: Learn how to build queries for hybrid search.
5
5
@@ -14,29 +14,29 @@ ms.date: 04/23/2024
14
14
15
15
# Create a hybrid query in Azure AI Search
16
16
17
-
Hybrid search combines one or more keyword queries with one or more vector queries in a single search request. The queries execute in parallel. The results are merged and reordered by new search scores, using [Reciprocal Rank Fusion (RRF)](hybrid-search-ranking.md) to return a single ranked result set.
17
+
[Hybrid search](hybrid-search-overview.md) combines one or more keyword queries with one or more vector queries in a single search request. The queries execute in parallel. The results are merged and reordered by new search scores, using [Reciprocal Rank Fusion (RRF)](hybrid-search-ranking.md) to return a single ranked result set.
18
18
19
19
In most cases, [per benchmark tests](https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/3929167), hybrid queries with semantic ranking return the most relevant results.
20
20
21
-
To define a hybrid query, use [**Search Post REST API version 2023-11-01**](/rest/api/searchservice/documents/search-post), **2023-10-01-preview** or higher, Search Explorer in the Azure portal, or newer versions of the Azure SDKs. For more information about hybrid search concepts, see [Hybrid search in Azure AI Search](hybrid-search-overview.md).
21
+
To define a hybrid query, use REST API [**2023-11-01**](/rest/api/searchservice/documents/search-post), **2023-10-01-preview** or higher, Search Explorer in the Azure portal, or newer versions of the Azure SDKs.
22
22
23
23
## Prerequisites
24
24
25
25
+ A search index containing `searchable` vector and nonvector fields. See [Create an index](search-how-to-create-search-index.md) and [Add vector fields to a search index](vector-search-how-to-create-index.md).
26
26
27
-
+ (Optional) If you want [semantic ranking](semantic-search-overview.md), your search service must be Basic tier or higher, with [semantic ranking enabled](semantic-how-to-enable-disable.md).
27
+
+ (Optional) If you want [semantic ranking](semantic-how-to-configure), your search service must be Basic tier or higher, with [semantic ranking enabled](semantic-how-to-enable-disable.md).
28
28
29
29
+ (Optional) If you want text-to-vector conversion of a query string (currently in preview), [create and assign a vectorizer](vector-search-how-to-configure-vectorizer.md) to vector fields in the search index.
30
30
31
31
## Run a hybrid query in Search Explorer
32
32
33
-
You can use the index and hybrid query from the [vector search quickstart (REST)](vector-search-how-to-configure-vectorizer.md#try-a-vectorizer-with-sample-data) as an example for this task. If you have the index, you can copy and paste the query from line 539 to 553 to run the hybrid query in Search Explorer.
34
-
35
-
1. In Search Explorer, make sure the API version is **2023-10-01-preview** or later.
33
+
1. In [Search Explorer](search-explorer.md), make sure the API version is **2023-10-01-preview** or later.
36
34
37
35
1. Under **View**, select **JSON view**.
38
36
39
-
1. Replace the default query template with a hybrid query, such as the one starting on line 539 for the vector quickstart example. For brevity, the vector is truncated. The text query is specified in `search`. The vector query is specified under `vectorQueries.vector`.
37
+
1. Replace the default query template with a hybrid query, such as the one starting on line 539 for the [vector quickstart example](vector-search-how-to-configure-vectorizer.md#try-a-vectorizer-with-sample-data). For brevity, the vector is truncated in this article.
38
+
39
+
A hybrid query has a text query specified in `search`, and a vectory query specified under `vectorQueries.vector`.
40
40
41
41
The text query and vector query should be equivalent or at least not conflict. If the queries are different, you don't get the benefit of hybrid.
42
42
@@ -62,7 +62,7 @@ You can use the index and hybrid query from the [vector search quickstart (REST)
62
62
63
63
## Hybrid query request (REST API)
64
64
65
-
A hybrid query combines text search and vector search, where the `"search"` parameter takes a query string and `"vectors.value"` takes the vector query. The search engine runs full text and vector queries in parallel. The union of all matches is evaluated for relevance using Reciprocal Rank Fusion (RRF) and a single result set is returned in the response.
65
+
A hybrid query combines text search and vector search, where the `search` parameter takes a query string and `vectorQueries.vector` takes the vector query. The search engine runs full text and vector queries in parallel. The union of all matches is evaluated for relevance using Reciprocal Rank Fusion (RRF) and a single result set is returned in the response.
66
66
67
67
Results are returned in plain text, including vectors in fields marked as `retrievable`. Because numeric vectors aren't useful in search results, choose other fields in the index as a proxy for the vector match. For example, if an index has "descriptionVector" and "descriptionText" fields, the query can match on "descriptionVector" but the search result can show "descriptionText". Use the `select` parameter to specify only human-readable fields in the results.
0 commit comments