Skip to content

Commit 1e9bf94

Browse files
committed
file rename
1 parent 3420729 commit 1e9bf94

File tree

4 files changed

+66
-119
lines changed

4 files changed

+66
-119
lines changed

articles/search/includes/quickstarts/dotnet-semantic.md renamed to articles/search/includes/quickstarts/semantic-ranker-csharp.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,31 @@ We recommend [Visual Studio](https://visualstudio.microsoft.com/vs/community/) f
6666
}
6767
```
6868

69-
## Add semantic configuration to an index
69+
## Update and query the index
7070

71-
TBD
71+
In this section, you update a search index and send a query that invokes semantic ranking. Visual Studio Code displays the response after you run each cell. For more information about each step, see [Explaining the code](#explaining-the-code).
72+
73+
74+
75+
### Run the program
76+
77+
Press F5 to rebuild the app and run the program in its entirety.
78+
79+
Output includes messages from [Console.WriteLine](/dotnet/api/system.console.writeline), with the addition of query information and results.
7280

73-
## Search with semantic reranking
81+
## Explaining the code
82+
83+
Add `SemanticConfiguration` to a search index definition. If you're updating an existing index, this modification doesn't require a reindexing because the structure of your documents is unchanged.
84+
85+
+ [Update an index with a semantic configuration](#add-a-semantic-configuration-to-the-index)
86+
+ [Query the index using semantic parameters](#add-semantic-ranking-to-queries)
87+
88+
### Add a semantic configuration to the index
7489

7590
TBD
7691

92+
### Add semantic ranking to queries
93+
7794
Here's a query that invokes semantic ranker, with search options for specifying parameters:
7895

7996
```csharp
@@ -105,8 +122,4 @@ In contrast, when semantic ranking is applied to the same query ("restaurant on
105122

106123
:::image type="content" source="../../media/quickstart-semantic/semantic-ranking.png" alt-text="Screenshot showing matches ranked based on semantic ranking.":::
107124

108-
### Run the program
109-
110-
Press F5 to rebuild the app and run the program in its entirety.
111125

112-
Output includes messages from [Console.WriteLine](/dotnet/api/system.console.writeline), with the addition of query information and results.

articles/search/includes/quickstarts/python-semantic.md renamed to articles/search/includes/quickstarts/semantic-ranker-python.md

Lines changed: 11 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,17 @@ It can take a minute to set up. If you run into problems, see [Python environmen
5353
index_name: str = "hotels-quickstart"
5454
```
5555

56-
### Create or update an index
56+
## Update and query the index
5757

58-
Create or update an index schema to include a `SemanticConfiguration`. If you're updating an existing index, this modification doesn't require a reindexing because the structure of your documents is unchanged.
58+
In this section, you update a search index and send a query that invokes semantic ranking. Visual Studio Code displays the response after you run each cell. For more information about each step, see [Explaining the code](#explaining-the-code).
59+
60+
## Explaining the code
61+
62+
Add `SemanticConfiguration` to a search index definition. If you're updating an existing index, this modification doesn't require a reindexing because the structure of your documents is unchanged.
63+
64+
Provide the entire schema plus the new SemanticConfiguration section. We recommend getting the index schema from the search service to ensure you're updating the correct schema.
65+
66+
This example is the Python code for the Hotels sample index schema, plus the semantic configuration.
5967

6068
```python
6169
from azure.search.documents.indexes import SearchIndexClient
@@ -72,7 +80,7 @@ from azure.search.documents.indexes.models import (
7280
SemanticSearch
7381
)
7482

75-
# Create a search schema
83+
# Update the search schema, providing the entire schema plus the changes.
7684
index_client = SearchIndexClient(
7785
endpoint=search_endpoint, credential=credential)
7886
fields = [
@@ -117,104 +125,6 @@ result = index_client.create_or_update_index(index)
117125
print(f' {result.name} created')
118126
```
119127

120-
### Create a documents payload
121-
122-
You can push JSON documents to a search index. Documents must match the index schema.
123-
124-
```python
125-
documents = [
126-
{
127-
"@search.action": "upload",
128-
"HotelId": "1",
129-
"HotelName": "Stay-Kay City Hotel",
130-
"Description": "This classic hotel is fully-refurbished and ideally located on the main commercial artery of the city in the heart of New York. A few minutes away is Times Square and the historic centre of the city, as well as other places of interest that make New York one of America's most attractive and cosmopolitan cities.",
131-
"Category": "Boutique",
132-
"Tags": [ "view", "air conditioning", "concierge" ],
133-
"ParkingIncluded": "false",
134-
"LastRenovationDate": "2022-01-18T00:00:00Z",
135-
"Rating": 3.60,
136-
"Address": {
137-
"StreetAddress": "677 5th Ave",
138-
"City": "New York",
139-
"StateProvince": "NY",
140-
"PostalCode": "10022",
141-
"Country": "USA"
142-
}
143-
},
144-
{
145-
"@search.action": "upload",
146-
"HotelId": "2",
147-
"HotelName": "Old Century Hotel",
148-
"Description": "The hotel is situated in a nineteenth century plaza, which has been expanded and renovated to the highest architectural standards to create a modern, functional and first-class hotel in which art and unique historical elements coexist with the most modern comforts. The hotel also regularly hosts events like wine tastings, beer dinners, and live music.",
149-
"Category": "Boutique",
150-
"Tags": [ "pool", "free wifi", "concierge" ],
151-
"ParkingIncluded": "false",
152-
"LastRenovationDate": "2019-02-18T00:00:00Z",
153-
"Rating": 3.60,
154-
"Address": {
155-
"StreetAddress": "140 University Town Center Dr",
156-
"City": "Sarasota",
157-
"StateProvince": "FL",
158-
"PostalCode": "34243",
159-
"Country": "USA"
160-
}
161-
},
162-
{
163-
"@search.action": "upload",
164-
"HotelId": "3",
165-
"HotelName": "Gastronomic Landscape Hotel",
166-
"Description": "The Gastronomic Hotel stands out for its culinary excellence under the management of William Dough, who advises on and oversees all of the Hotel’s restaurant services.",
167-
"Category": "Suite",
168-
"Tags": [ "restaurant", "bar", "continental breakfast" ],
169-
"ParkingIncluded": "true",
170-
"LastRenovationDate": "2015-09-20T00:00:00Z",
171-
"Rating": 4.80,
172-
"Address": {
173-
"StreetAddress": "3393 Peachtree Rd",
174-
"City": "Atlanta",
175-
"StateProvince": "GA",
176-
"PostalCode": "30326",
177-
"Country": "USA"
178-
}
179-
},
180-
{
181-
"@search.action": "upload",
182-
"HotelId": "4",
183-
"HotelName": "Sublime Palace Hotel",
184-
"Description": "Sublime Palace Hotel is located in the heart of the historic center of Sublime in an extremely vibrant and lively area within short walking distance to the sites and landmarks of the city and is surrounded by the extraordinary beauty of churches, buildings, shops and monuments. Sublime Cliff is part of a lovingly restored 19th century resort, updated for every modern convenience.",
185-
"Category": "Boutique",
186-
"Tags": [ "concierge", "view", "air conditioning" ],
187-
"ParkingIncluded": "true",
188-
"LastRenovationDate": "2020-02-06T00:00:00Z",
189-
"Rating": 4.60,
190-
"Address": {
191-
"StreetAddress": "7400 San Pedro Ave",
192-
"City": "San Antonio",
193-
"StateProvince": "TX",
194-
"PostalCode": "78216",
195-
"Country": "USA"
196-
}
197-
}
198-
]
199-
```
200-
201-
### Upload documents to the index
202-
203-
```python
204-
search_client = SearchClient(endpoint=search_endpoint,
205-
index_name=index_name,
206-
credential=credential)
207-
try:
208-
result = search_client.upload_documents(documents=documents)
209-
print("Upload of new document succeeded: {}".format(result[0].succeeded))
210-
except Exception as ex:
211-
print (ex.message)
212-
213-
214-
index_client = SearchIndexClient(
215-
endpoint=search_endpoint, credential=credential)
216-
```
217-
218128
### Run your first query
219129

220130
Start with an empty query as a verification step, proving that the index is operational. You should get an unordered list of hotel names and descriptions, with a count of 4 indicating that there are four documents in the index.

articles/search/includes/quickstarts/semantic-ranker-rest.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,38 @@ We recommend [Visual Studio Code](https://code.visualstudio.com/download) with a
2020

2121
1. Start Visual Studio Code and create a new .http or .rest file.
2222

23-
1. At the top, specify environment variables.
23+
1. At the top, specify environment variables for your search service, authorization, and index name.
24+
25+
+ For @baseURL, sign in to the Azure portal and copy the URL from the search service **Overview** page.
26+
27+
+ For @token, follow the instruction in [Connect without keys](../../search-get-started-rbac.md) to get your personal identity token.
28+
29+
+ For @index-name, provide a unique name or use the default, *hotel-semantic-quickstart*.
2430

2531
1. Paste in your first request and then select **Send**. This request returns a list of existing indexes. You should get an HTTP 200 Success status code and a list of indexes, including hotels-sample-index. This step confirms access to the search service.
2632

27-
## Add semantic configuration to an index
33+
```http
34+
### List existing indexes by name (verify the connection)
35+
GET {{baseUrl}}/indexes?api-version=2024-07-01&$select=name HTTP/1.1
36+
Content-Type: application/json
37+
Authorization: Bearer {{token}}
38+
```
2839

29-
TBD
40+
## Update and query the index
41+
42+
In this section, you make REST API calls to update a search index and send a query that invokes semantic ranking. Visual Studio Code displays the response to each request in an adjacent pane. For more information about each step, see [Explaining the code](#explaining-the-code).
43+
44+
## Explaining the code
45+
46+
This section explains the REST API calls that you made to:
47+
48+
+ [Update an index with a semantic configuration](#add-a-semantic-configuration-to-the-index)
49+
+ [Query the index using semantic parameters](#add-semantic-ranking-to-queries)
3050

31-
## Search with semantic reranking
51+
### Add a semantic configuration to the index
3252

3353
TBD
3454

55+
### Add semantic ranking to queries
3556

57+
TBD

articles/search/search-get-started-semantic.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ ms.custom:
1111
- devx-track-python
1212
- ignite-2023
1313
ms.topic: quickstart
14-
ms.date: 06/25/2025
14+
ms.date: 06/27/2025
1515
zone_pivot_groups: search-get-started-semantic
1616
---
1717

1818
# Quickstart: Semantic ranking
1919

2020
::: zone pivot="csharp"
2121

22-
[!INCLUDE [C# quickstart](includes/quickstarts/dotnet-semantic.md)]
22+
[!INCLUDE [C# quickstart](includes/quickstarts/semantic-ranker-dotnet.md)]
2323

2424
::: zone-end
2525

2626
::: zone pivot="python"
2727

28-
[!INCLUDE [Python quickstart](includes/quickstarts/python-semantic.md)]
28+
[!INCLUDE [Python quickstart](includes/quickstarts/semantic-ranker-python.md)]
2929

3030
::: zone-end
3131

@@ -41,9 +41,11 @@ When you're working in your own subscription, it's a good idea at the end of a p
4141

4242
You can find and manage resources in the Azure portal, using the **All resources** or **Resource groups** link in the left-navigation pane.
4343

44-
## Next step
44+
## Related content
4545

46-
In this quickstart, you learned how to invoke semantic ranking on an existing index. We recommend trying semantic ranking on your own indexes as a next step. However, if you want to continue with demos, try the following tutorial:
46+
In this quickstart, you learned how to invoke semantic ranking on an existing index. We recommend trying semantic ranking on your own indexes as a next step. The following articles can help you get started.
4747

48-
> [!div class="nextstepaction"]
49-
> [Tutorial: Add search to web apps](tutorial-csharp-overview.md)
48+
+ [Semantic ranking overview](semantic-search-overview.md)
49+
+ [Configure semantic ranker ](semantic-how-to-configure.md)
50+
+ [Add query rewrite to semantic ranking](semantic-how-to-query-rewrite.md)
51+
+ [Use scoring profiles and semantic ranking together](semantic-how-to-enable-scoring-profiles.md)

0 commit comments

Comments
 (0)