Skip to content

Commit e815e6b

Browse files
committed
Quickstart REST updates, synchronize to sample data
1 parent c9da546 commit e815e6b

7 files changed

+140
-159
lines changed

articles/search/index-add-scoring-profiles.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,28 @@ ms.service: azure-ai-search
1010
ms.custom:
1111
- ignite-2023
1212
ms.topic: how-to
13-
ms.date: 02/25/2025
13+
ms.date: 06/10/2025
1414
---
1515

1616
# Add scoring profiles to boost search scores
1717

18-
Scoring profiles are used to boost the ranking of matching documents based on criteria. In this article, learn how to specify and assign a scoring profile that boosts a search score based on parameters that you provide.
18+
Scoring profiles are used to boost the ranking of matching documents based on criteria. In this article, learn how to specify and assign a scoring profile that boosts a search score based on parameters that you provide. You can create scoring profiles based on:
1919

20-
You can use scoring profiles for [keyword search](search-lucene-query-architecture.md), [vector search](vector-search-overview.md), and [hybrid search](hybrid-search-overview.md). However, scoring profiles only apply to nonvector fields, so make sure your index has text or numeric fields that can be used in a scoring profile.
20+
+ Weighted fields, where boosting is based on a match found in a specific string field. For example, if matches found in a "Subject" field should be more relevant than the same match found in a "Description" field.
2121

22-
## Prerequisites
23-
24-
+ A new or existing search index with text or numeric fields.
25-
26-
You can specify a scoring profile in the index designer in the Azure portal or through APIs like [Create or Update Index REST](/rest/api/searchservice/indexes/create-or-update) or equivalent APIs in any Azure SDK.
22+
+ Functions for numeric data, including dates, ranges, and geographic coordinates. There's also a Tags function that operates on a field providing an arbitrary collection of strings. You can choose this approach over weighted fields if you want to boost a score based on whether a match is found in a tags field.
2723

28-
Scoring profile support for vector and hybrid search is available in 2024-05-01-preview and 2024-07-01 REST APIs and in Azure SDK packages that targeting those releases.
24+
You can add a scoring profile to an index by editing its JSON definition in the Azure portal or programmatically through APIs like [Create or Update Index REST](/rest/api/searchservice/indexes/create-or-update) or equivalent APIs in any Azure SDK.
2925

30-
## Key points about scoring profiles
26+
## Prerequisites
3127

32-
Scoring profile parameters are either:
28+
You can use any API version or SDK package for scoring profiles in keyword search. For vector and hybrid search, use 2024-05-01-preview and 2024-07-01 REST APIs or Azure SDK packages that provide feature parity. For integration between scoring profiles and semantic ranker, use 2025-05-01-preview and later.
3329

34-
+ Weighted fields, where a match is found in a specific string field. For example, you might want matches found in a "summary" field to be more relevant than the same match found in a "content" field.
30+
## Rules for scoring profiles
3531

36-
+ Functions for numeric data, including dates, ranges, and geographic coordinates. There's also a Tags function that operates on a field providing an arbitrary collection of strings. You can choose this approach over weighted fields if you want to boost a score based on whether a match is found in a tags field.
32+
You must have a new or existing search index with text or numeric fields.
3733

38-
You can create multiple profiles and then modify query logic to choose which one is used.
34+
You can use scoring profiles in [keyword search](search-lucene-query-architecture.md), [vector search](vector-search-overview.md), and [hybrid search](hybrid-search-overview.md). However, scoring profiles only apply to nonvector fields, so make sure your index has text or numeric fields that can be boosted or weighted.
3935

4036
You can have up to 100 scoring profiles within an index (see [service Limits](search-limits-quotas-capacity.md)), but you can only specify one profile at time in any given query.
4137

@@ -76,13 +72,7 @@ The following definition shows a simple profile named "geo". This example boosts
7672
]
7773
```
7874

79-
To use this scoring profile, your query is formulated to specify scoringProfile parameter in the request. If you're using the REST API, queries are specified through GET and POST requests. In the following example, "currentLocation" has a delimiter of a single dash (`-`). It's followed by longitude and latitude coordinates, where longitude is a negative value.
80-
81-
```http
82-
GET /indexes/hotels/docs?search+inn&scoringProfile=geo&scoringParameter=currentLocation--122.123,44.77233&api-version=2024-07-01
83-
```
84-
85-
Notice the syntax differences when using POST. In POST, "scoringParameters" is plural and it's an array.
75+
To use this scoring profile, your query is formulated to specify `scoringProfile` parameter in the request. If you're using the REST API, queries are specified through GET and POST requests. In the following example, "currentLocation" has a delimiter of a single dash (`-`). It's followed by longitude and latitude coordinates, where longitude is a negative value.
8676

8777
```http
8878
POST /indexes/hotels/docs&api-version=2024-07-01
@@ -119,15 +109,15 @@ For text queries in a hybrid query, scoring profiles identify the maximum 1,000
119109

120110
1. Paste in the [template](#template) provided in this article.
121111

122-
1. Provide a name that adheres to [naming conventions](/rest/api/searchservice/naming-rules).
112+
1. Provide a name that adheres to [Azure AI Search naming conventions](/rest/api/searchservice/naming-rules).
123113

124114
1. Specify boosting criteria. A single profile can contain [text weighted fields](#use-text-weighted-fields), [functions](#use-functions), or both.
125115

126116
You should work iteratively, using a data set that will help you prove or disprove the efficacy of a given profile.
127117

128118
Scoring profiles can be defined in Azure portal as shown in the following screenshot, or programmatically through [REST APIs](/rest/api/searchservice/indexes/create-or-update) or in Azure SDKs, such as the [ScoringProfile](/dotnet/api/azure.search.documents.indexes.models.scoringprofile) class in the Azure SDK for .NET.
129119

130-
:::image type="content" source="media/scoring-profiles/portal-add-scoring-profile-small.png" alt-text="Add scoring profiles page" lightbox="media/scoring-profiles/portal-add-scoring-profile.png" border="true":::
120+
:::image type="content" source="media/scoring-profiles/portal-add-scoring-profile-small.png" alt-text="Add scoring profiles page" lightbox="media/scoring-profiles/portal-add-scoring-profile.png" border="true":::
131121

132122
## Use text-weighted fields
133123

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

Lines changed: 77 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: haileytapia
88
ms.service: azure-ai-search
99
ms.topic: quickstart
1010
ms.devlang: rest-api
11-
ms.date: 03/04/2025
11+
ms.date: 06/12/2025
1212
ms.custom:
1313
- mode-api
1414
- ignite-2023
@@ -180,86 +180,85 @@ To push documents, use an HTTP POST request to your index's URL endpoint. The RE
180180
181181
```powershell
182182
$body = @"
183-
{
184-
"value": [
185183
{
186-
"@search.action": "upload",
187-
"HotelId": "1",
188-
"HotelName": "Stay-Kay City Hotel",
189-
"Description": "The hotel is ideally located on the main commercial artery of the city in the heart of New York. A few minutes away is Time's 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.",
190-
"Category": "Boutique",
191-
"Tags": [ "pool", "air conditioning", "concierge" ],
192-
"ParkingIncluded": false,
193-
"LastRenovationDate": "1970-01-18T00:00:00Z",
194-
"Rating": 3.60,
195-
"Address":
184+
"value": [
196185
{
197-
"StreetAddress": "677 5th Ave",
198-
"City": "New York",
199-
"StateProvince": "NY",
200-
"PostalCode": "10022",
201-
"Country": "USA"
202-
}
203-
},
204-
{
205-
"@search.action": "upload",
206-
"HotelId": "2",
207-
"HotelName": "Old Century Hotel",
208-
"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.",
209-
"Category": "Boutique",
210-
"Tags": [ "pool", "free wifi", "concierge" ],
211-
"ParkingIncluded": false,
212-
"LastRenovationDate": "1979-02-18T00:00:00Z",
213-
"Rating": 3.60,
214-
"Address":
186+
"@search.action": "upload",
187+
"HotelId": "1",
188+
"HotelName": "Stay-Kay City Hotel",
189+
"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.",
190+
"Category": "Boutique",
191+
"Tags": [ "view", "air conditioning", "concierge" ],
192+
"ParkingIncluded": false,
193+
"LastRenovationDate": "2022-01-18T00:00:00Z",
194+
"Rating": 3.60,
195+
"Address":
196+
{
197+
"StreetAddress": "677 5th Ave",
198+
"City": "New York",
199+
"StateProvince": "NY",
200+
"PostalCode": "10022",
201+
"Country": "USA"
202+
}
203+
},
215204
{
216-
"StreetAddress": "140 University Town Center Dr",
217-
"City": "Sarasota",
218-
"StateProvince": "FL",
219-
"PostalCode": "34243",
220-
"Country": "USA"
221-
}
222-
},
223-
{
224-
"@search.action": "upload",
225-
"HotelId": "3",
226-
"HotelName": "Gastronomic Landscape Hotel",
227-
"Description": "The Hotel stands out for its gastronomic excellence under the management of William Dough, who advises on and oversees all of the Hotel’s restaurant services.",
228-
"Category": "Resort and Spa",
229-
"Tags": [ "air conditioning", "bar", "continental breakfast" ],
230-
"ParkingIncluded": true,
231-
"LastRenovationDate": "2015-09-20T00:00:00Z",
232-
"Rating": 4.80,
233-
"Address":
205+
"@search.action": "upload",
206+
"HotelId": "2",
207+
"HotelName": "Old Century Hotel",
208+
"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.",
209+
"Category": "Boutique",
210+
"Tags": [ "pool", "free wifi", "concierge" ],
211+
"ParkingIncluded": false,
212+
"LastRenovationDate": "2019-02-18T00:00:00Z",
213+
"Rating": 3.60,
214+
"Address":
215+
{
216+
"StreetAddress": "140 University Town Center Dr",
217+
"City": "Sarasota",
218+
"StateProvince": "FL",
219+
"PostalCode": "34243",
220+
"Country": "USA"
221+
}
222+
},
234223
{
235-
"StreetAddress": "3393 Peachtree Rd",
236-
"City": "Atlanta",
237-
"StateProvince": "GA",
238-
"PostalCode": "30326",
239-
"Country": "USA"
240-
}
241-
},
242-
{
243-
"@search.action": "upload",
244-
"HotelId": "4",
245-
"HotelName": "Sublime Palace Hotel",
246-
"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 Palace is part of a lovingly restored 1800 palace.",
247-
"Category": "Boutique",
248-
"Tags": [ "concierge", "view", "24-hour front desk service" ],
249-
"ParkingIncluded": true,
250-
"LastRenovationDate": "1960-02-06T00:00:00Z",
251-
"Rating": 4.60,
252-
"Address":
224+
"@search.action": "upload",
225+
"HotelId": "3",
226+
"HotelName": "Gastronomic Landscape Hotel",
227+
"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.",
228+
"Category": "Suite",
229+
"Tags": [ "restaurant", "bar", "continental breakfast" ],
230+
"ParkingIncluded": true,
231+
"LastRenovationDate": "2015-09-20T00:00:00Z",
232+
"Rating": 4.80,
233+
"Address":
234+
{
235+
"StreetAddress": "3393 Peachtree Rd",
236+
"City": "Atlanta",
237+
"StateProvince": "GA",
238+
"PostalCode": "30326",
239+
"Country": "USA"
240+
}
241+
},
253242
{
254-
"StreetAddress": "7400 San Pedro Ave",
255-
"City": "San Antonio",
256-
"StateProvince": "TX",
257-
"PostalCode": "78216",
258-
"Country": "USA"
243+
"@search.action": "upload",
244+
"HotelId": "4",
245+
"HotelName": "Sublime Palace Hotel",
246+
"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.",
247+
"Tags": [ "concierge", "view", "air conditioning" ],
248+
"ParkingIncluded": true,
249+
"LastRenovationDate": "2020-02-06T00:00:00Z",
250+
"Rating": 4.60,
251+
"Address":
252+
{
253+
"StreetAddress": "7400 San Pedro Ave",
254+
"City": "San Antonio",
255+
"StateProvince": "TX",
256+
"PostalCode": "78216",
257+
"Country": "USA"
258+
}
259259
}
260+
]
260261
}
261-
]
262-
}
263262
"@
264263
```
265264
@@ -343,17 +342,17 @@ Be sure to use single quotation marks on search `$urls`. Query strings include `
343342
"Category": "Boutique",
344343
"Tags": "pool free wifi concierge",
345344
"ParkingIncluded": false,
346-
"LastRenovationDate": "1979-02-18T00:00:00Z",
345+
"LastRenovationDate": "2019-02-18T00:00:00Z",
347346
"Rating": 3.6,
348347
"Address": "@{StreetAddress=140 University Town Center Dr; City=Sarasota; StateProvince=FL; PostalCode=34243; Country=USA}"
349348
},
350349
{
351350
"@search.score": 0.009068266,
352351
"HotelId": "3",
353352
"HotelName": "Gastronomic Landscape Hotel",
354-
"Description": "The Hotel stands out for its gastronomic excellence under the management of William Dough, who advises on and oversees all of the Hotel\u0027s restaurant services.",
355-
"Category": "Resort and Spa",
356-
"Tags": "air conditioning bar continental breakfast",
353+
"Description": "The Hotel stands out for its gastronomic excellence under the management of William Dough, who advises on and oversees all of the Hotel's restaurant services.",
354+
"Category": "Suite",
355+
"Tags": "restaurant", "bar", "continental breakfast",
357356
"ParkingIncluded": true,
358357
"LastRenovationDate": "2015-09-20T00:00:00Z",
359358
"Rating": 4.8,
@@ -383,7 +382,6 @@ $url = 'https://<YOUR-SEARCH-SERVICE>.search.windows.net/indexes/hotels-quicksta
383382
384383
# Query example 4
385384
# Sort by a specific field (Address/City) in ascending order
386-
387385
$url = 'https://<YOUR-SEARCH-SERVICE>.search.windows.net/indexes/hotels-quickstart/docs?api-version=2024-07-01&search=pool&$orderby=Address/City asc&$select=HotelName, Address/City, Tags, Rating'
388386
```
389387

0 commit comments

Comments
 (0)