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/includes/quickstarts/search-get-started-vector-java.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,11 +92,11 @@ You should now be logged in to Azure from your local device.
92
92
93
93
In this section, you create a vector index in Azure AI Search with [SearchIndexClient](/java/api/com.azure.search.documents.indexes.searchindexclient).[createOrUpdateIndex](/java/api/com.azure.search.documents.indexes.searchindexclient#com-azure-search-documents-indexes-searchindexclient-createorupdateindex(com-azure-search-documents-indexes-models-searchindex)). The index schema defines the fields, including the vector field `DescriptionVector`.
94
94
95
-
1. Create a `CreateIndex.java` file in the `src/main/java/com/azure/search` directory.
95
+
1. Create a `CreateIndex.java` file in the `src/main/java/com/example/search` directory.
This code loads a collection of documents. Each document includes the vectorized version of the article's `Description`. This vector enables similarity search, where matching is based on meaning rather than exact keywords.
143
143
@@ -182,21 +182,21 @@ The example vector queries are based on two strings:
182
182
183
183
The vector query string is semantically similar to the search string, but it includes terms that don't exist in the search index. If you do a keyword search for `quintessential lodging near running trails, eateries, retail`, results are zero. We use this example to show how you can get relevant results even if there are no matching terms.
184
184
185
-
Create a `QueryVector.java` file in the `src/main/java/com/azure/search` directory and add the code to create the query vector.
185
+
Create a `QueryVector.java` file in the `src/main/java/com/example/search` directory and add the code to create the query vector.
This code is used in the following sections to perform vector searches. The query vector is created using an embedding model from Azure OpenAI.
190
190
191
191
## Create a single vector search
192
192
193
193
The first example demonstrates a basic scenario where you want to find document descriptions that closely match the search string using the [SearchClient](/java/api/com.azure.search.documents.searchclient).[search](/java/api/com.azure.search.documents.searchasyncclient#com-azure-search-documents-searchasyncclient-search(java-lang-string)) and the [VectorQuery](/java/api/com.azure.search.documents.models.vectorquery) and [SearchOptions](/java/api/com.azure.search.documents.models.searchoptions).
194
194
195
-
1. Create a `SearchSingle.java` file in the `src/main/java/com/azure/search` directory.
195
+
1. Create a `SearchSingle.java` file in the `src/main/java/com/example/search` directory.
The `vectorQuery` contains the configuration of the vectorized query including the vectorized text of the query input as retrieved through `QueryVector.getVectorList`. `setFields` determines which vector fields are searched and `setKNearestNeighborsCount` specifies the number of nearest neighbors to return.
202
202
@@ -229,11 +229,11 @@ The first example demonstrates a basic scenario where you want to find document
229
229
230
230
You can add filters, but the filters are applied to the nonvector content in your index. In this example, the filter applies to the `Tags` field to filter out any hotels that don't provide free Wi-Fi. This search uses [SearchClient](/java/api/com.azure.search.documents.searchclient).[SearchClient](/java/api/com.azure.search.documents.searchclient) and [SearchOptions](/java/api/com.azure.search.documents.models.searchoptions).
231
231
232
-
1. Create a `SearchSingleWithFilter.java` file in the `src/main/java/com/azure/search` directory.
232
+
1. Create a `SearchSingleWithFilter.java` file in the `src/main/java/com/example/search` directory.
This code has the same search functionality as the previous search with a post-processing exclusion filter added for hotels with `free wifi`.
239
239
@@ -258,11 +258,11 @@ You can add filters, but the filters are applied to the nonvector content in you
258
258
259
259
You can specify a geospatial filter to limit results to a specific geographic area. In this example, the filter limits results to hotels within 300 kilometers of Washington D.C. (coordinates: `-77.03241 38.90166`). Geospatial distances are always in kilometers. This search uses [SearchClient](/java/api/com.azure.search.documents.searchclient).[SearchClient](/java/api/com.azure.search.documents.searchclient) and [SearchOptions](/java/api/com.azure.search.documents.models.searchoptions).
260
260
261
-
1. Create a `SearchSingleWithFilterGeo.java` file in the `src/main/java/com/azure/search` directory.
261
+
1. Create a `SearchSingleWithFilterGeo.java` file in the `src/main/java/com/example/search` directory.
@@ -290,11 +290,11 @@ Hybrid search consists of keyword queries and vector queries in a single search
290
290
291
291
This search uses [SearchClient](/java/api/com.azure.search.documents.searchclient).[SearchClient](/java/api/com.azure.search.documents.searchclient) and [SearchOptions](/java/api/com.azure.search.documents.models.searchoptions).
292
292
293
-
1. Create a `SearchHybrid.java` file in the `src/main/java/com/azure/search` directory.
293
+
1. Create a `SearchHybrid.java` file in the `src/main/java/com/example/search` directory.
@@ -422,11 +422,11 @@ Here's the last query in the collection to create extend the semantic hybrid sea
422
422
423
423
This search uses [SearchClient](/java/api/com.azure.search.documents.searchclient).[SearchClient](/java/api/com.azure.search.documents.searchclient) and [SearchOptions](/java/api/com.azure.search.documents.models.searchoptions).
424
424
425
-
1. Create a `SearchSemanticHybrid.java` file in the `src/main/java/com/azure/search` directory.
425
+
1. Create a `SearchSemanticHybrid.java` file in the `src/main/java/com/example/search` directory.
0 commit comments