Skip to content

Commit 05f05c6

Browse files
committed
misc edits
1 parent 3c64a12 commit 05f05c6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

articles/search/vector-search-how-to-create-index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The schema must include fields for the document key, vector fields, and any othe
5050
> + Both new and existing indexes support vector search. However, there is a small subset of older services that don't support vector search. In this case, a new search service must be created to use it.
5151
> + Updating an existing index to add vector fields requires `allowIndexDowntime` query parameter to be `true`.
5252
53-
1. Use the [Create or Update Index Preview REST API](/rest/api/searchservice/preview-api/create-or-update-index) to add vector fields.
53+
1. Use the [Create or Update Index Preview REST API](/rest/api/searchservice/preview-api/create-or-update-index) to create the index.
5454

5555
1. Create a `vectorSearch` section in the index that specifies the algorithm used to create the embedding space. Currently, only `"hnsw"` is supported.
5656

@@ -73,7 +73,7 @@ The schema must include fields for the document key, vector fields, and any othe
7373

7474
1. Add fields that define the substance and structure of the content you're indexing. At a minimum, you need a document key.
7575

76-
You should also add fields that are useful in the query response. The example below shows vector fields for title and content ("titleVector", "contentVector"). It also provides fields for equivalent textual content ("title", "content") that users can read in a search result.
76+
You should also add fields that are useful in the query or in it's response. The example below shows vector fields for title and content ("titleVector", "contentVector"). It also provides fields for equivalent textual content ("title", "content") useful for sorting, filtering, and reading in a search result.
7777

7878
1. Add vector fields to the fields collection. You can store one generated embedding per document field. For each vector field:
7979

@@ -84,6 +84,8 @@ The schema must include fields for the document key, vector fields, and any othe
8484
+ "searchable" must be "true".
8585
+ "retrievable" set to "true" allows you to display the raw vectors (for example, as a verification step), but doing so will increase storage. Set to "false" if you don't need to return raw vectors. You don't need to return vectors for a query, but if you're passing a vector result to a downstream app then set "retrievable" to "true".
8686

87+
An index definition with the described elements looks like this:
88+
8789
```http
8890
PUT https://my-search-service.search.windows.net/indexes/my-index?api-version=2023-07-01-Preview&allowIndexDowntime=true
8991
Content-Type: application/json

articles/search/vector-search-how-to-query.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.date: 07/14/2023
1717
1818
In Azure Cognitive Search, if you added vector fields to a search index, this article explains how to query those fields. It also explains how to combine vector queries with full text search and semantic search for hybrid query combination scenarios.
1919

20-
Query execution in Cognitive Search doesn't include vector conversion. Encoding (text-to-vector) of the query string requires that you pass the text to an embedding model for vectorization. The output of the call to the embedding model is then passed to the search engine for similarity search over vector fields.
20+
Query execution in Cognitive Search doesn't include vector conversion. Encoding (text-to-vector) of the query string requires that you pass the text to an embedding model for vectorization. You would then pass the output of the call to the embedding model to the search engine for similarity search over vector fields.
2121

2222
## Prerequisites
2323

@@ -37,7 +37,7 @@ If you aren't sure whether your search index already has vector fields, look for
3737

3838
+ In the fields collection, look for fields of type `Collection(Edm.Single)`, with a `dimensions` attribute and a `vectorSearchConfiguration` set to the name of the `vectorSearch` algorithm configuration used by the field.
3939

40-
You can also send an empty query (`search=*`) against the index if the vector field is "retrievable". In a response, a vector field consists of an array of floating point values.
40+
You can also send an empty query (`search=*`) against the index. If the vector field is "retrievable", the response includes a vector field consisting of an array of floating point values.
4141

4242
## Convert query input into a vector
4343

@@ -83,7 +83,7 @@ The expected response is 202 for a successful call to the deployed model. The bo
8383

8484
When you're setting up the vector query, think about the response structure. Search results are composed of either all "retrievable" fields (a REST API default) or the fields explicitly listed in a "select" parameter on the query. In the examples that follow, each one includes a "select" statement that specifies text (non-vector) fields to include the response.
8585

86-
Vectors aren't designed for readability, so avoid returning them in the response. Instead, choose non-vector fields that are representative of the search document. For example, if the query targets a "descriptionVector" field, return an equivalent text field ("description") in the response.
86+
Vectors aren't designed for readability, so avoid returning them in the response. Instead, choose non-vector fields that are representative of the search document. For example, if the query targets a "descriptionVector" field, return an equivalent text field if you have one ("description") in the response.
8787

8888
Size of the results is determined by the query parameters "k" and "top". Maximum results in a response are either:
8989

@@ -93,11 +93,11 @@ Size of the results is determined by the query parameters "k" and "top". Maximum
9393

9494
Ranking of results is either:
9595

96-
+ Cosine similarity if the query is over a single vector field, assuming `cosine` is what you specified in the index `vectorConfiguration`. Azure OpenAI embedding models use cosine similarity metrics. Other supported ranking metrics include `euclidean` and `dotProduct`.
96+
+ Cosine similarity if the query is over a single vector field, assuming `cosine` is what you specified in the index `vectorConfiguration`. Azure OpenAI embedding models use cosine similarity, so if you're using Azure OpenAI embedding models, `cosine` is the recommended metric. Other supported ranking metrics include `euclidean` and `dotProduct`.
9797

9898
+ Reciprocal Rank Fusion (RRF) if there are multiple sets of search results. Multiple sets are created if the query targets multiple vector fields, or if the query is a hybrid of vector and full text search, with or without the optional semantic reranking capabilities of [semantic search](semantic-search-overview.md).
9999

100-
Within vector search, a vector query can only target one internal vector index. So for [multiple vector fields](#query-syntax-for-vector-query-over-multiple-fields) and [multiple vector queries](#query-syntax-for-multiple-vector-queries), the search engine generates parallel queries that target the respective vector indexes of each field. Output is a set of ranked results for each query, which are fused using RRF. For more information, see [Vector query execution and scoring](vector-search-ranking.md).
100+
Within vector search, a vector query can only target one internal vector index. So for [multiple vector fields](#query-syntax-for-vector-query-over-multiple-fields) and [multiple vector queries](#query-syntax-for-multiple-vector-queries), the search engine generates parallel queries that target the respective vector indexes of each field. Output is a set of ranked results for each query, which are fused using RRF. For more information, see [Vector query execution and scoring](vector-search-ranking.md).
101101

102102
## Query syntax for vector search
103103

0 commit comments

Comments
 (0)