Skip to content

Commit 98d9dd2

Browse files
authored
Merge pull request #6565 from HeidiSteen/heidist-freshness
freshness pass, August 2025
2 parents 5a2d249 + 80a4115 commit 98d9dd2

File tree

2 files changed

+79
-23
lines changed

2 files changed

+79
-23
lines changed

articles/search/includes/quickstarts/search-get-started-rbac-rest.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: haileytap
44
ms.author: haileytapia
55
ms.service: azure-ai-search
66
ms.topic: include
7-
ms.date: 07/09/2025
7+
ms.date: 08/13/2025
88
---
99

1010
In this quickstart, you use role-based access control (RBAC) and Microsoft Entra ID to establish a keyless connection to your Azure AI Search service. You then use REST in Visual Studio Code to interact with your service.
@@ -33,10 +33,18 @@ To get your token:
3333

3434
1. On your local system, open a command-line tool.
3535

36-
1. Sign in to Azure. If you have multiple subscriptions, select the one whose ID you obtained in [Get service information](#get-service-information).
36+
1. Check for the active tenant and subscription in your local environment.
3737

3838
```azurecli
39-
az login
39+
az account show
40+
```
41+
42+
1. If the active subscription and tenant aren't valid for your search service, change the variables. You can check for the subscription ID on the search service overview page in the Azure portal. You can check for the tenant ID by clicking through to the subscription. Make a note of the values that are valid for your search service and run the following commands to update your local environment.
43+
44+
```azurecli
45+
az account set --subscription <your-subscription-id>
46+
47+
az login --tenant <your-tenant-id>
4048
```
4149

4250
1. Generate an access token.

articles/search/index-similarity-and-scoring.md

Lines changed: 68 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ ms.service: azure-ai-search
88
ms.custom:
99
- ignite-2023
1010
ms.topic: conceptual
11-
ms.date: 01/17/2025
11+
ms.date: 08/13/2025
1212
---
1313

1414
# Relevance in keyword search (BM25 scoring)
1515

16-
This article explains the BM25 relevance scoring algorithm used to compute search scores for [full text search](search-lucene-query-architecture.md). BM25 relevance is exclusive to full text search. Filter queries, autocomplete and suggested queries, wildcard search, and fuzzy search queries aren't scored or ranked for relevance.
16+
This article explains the BM25 relevance scoring algorithm used to compute search scores for [full text search](search-lucene-query-architecture.md). BM25 relevance applies to full text search only. Filter queries, autocomplete and suggested queries, wildcard search, and fuzzy search queries aren't scored or ranked for relevance.
1717

1818
## Scoring algorithms used in full text search
1919

@@ -133,40 +133,88 @@ In Azure AI Search, for keyword search and the text portion of a hybrid query, y
133133

134134
## featuresMode parameter (preview)
135135

136-
[Search Documents](/rest/api/searchservice/documents/search-post) requests support a featuresMode parameter that provides more detail about a BM25 relevance score at the field level. Whereas the `@searchScore` is calculated for the document all-up (how relevant is this document in the context of this query), featuresMode reveals information about individual fields, as expressed in a `@search.features` structure. The structure contains all fields used in the query (either specific fields through **searchFields** in a query, or all fields attributed as **searchable** in an index).
136+
> [!NOTE]
137+
> The `featuresMode` parameter isn't documented in the REST APIs, but you can use it on a preview REST API call to Search Documents for text (Keyword) search that's BM25-ranked.
138+
139+
[Search Documents (preview)](/rest/api/searchservice/documents/search-post?view=rest-searchservice-2025-05-01-preview&preserve-view=true) requests support a `featuresMode` parameter that provides more detail about a BM25 relevance score at the field level. Whereas the `@searchScore` is calculated for the document all-up (how relevant is this document in the context of this query), featuresMode reveals information about individual fields, as expressed in a `@search.features` structure. The structure contains all fields used in the query (either specific fields through **searchFields** in a query, or all fields attributed as **searchable** in an index).
140+
141+
Valid values for featuresMode:
142+
143+
+ "none" (default). No feature-level scoring details are returned.
144+
+ "enabled". Returns detailed scoring breakdowns per field
137145

138146
For each field, `@search.features` give you the following values:
139147

140148
+ Number of unique tokens found in the field
141149
+ Similarity score, or a measure of how similar the content of the field is, relative to the query term
142150
+ Term frequency, or the number of times the query term was found in the field
143151

144-
For a query that targets the "description" and "title" fields, a response that includes `@search.features` might look like this:
152+
This parameter is especially useful when you're trying to understand why certain documents rank higher or lower in search results. It helps explain how different fields contribute to the overall score.
153+
154+
For a query that targets a "description" field, a request might look like this:
155+
156+
```http
157+
POST {{baseUrl}}/indexes/hotels-sample-index/docs/search?api-version=2025-05-01-preview HTTP/1.1
158+
Content-Type: application/json
159+
Authorization: Bearer {{accessToken}}
160+
161+
{
162+
"search": "lake view",
163+
"select": "HotelId, HotelName, Tags, Description",
164+
"featuresMode": "enabled",
165+
"searchFields": "Description, Tags",
166+
"count": true
167+
}
168+
```
169+
170+
A response that includes `@search.features` might look like the following example.
145171

146172
```json
147-
"value": [
148-
{
149-
"@search.score": 5.1958685,
150-
"@search.features": {
151-
"description": {
152-
"uniqueTokenMatches": 1.0,
153-
"similarityScore": 0.29541412,
154-
"termFrequency" : 2
173+
"value": [
174+
{
175+
"@search.score": 3.0860271,
176+
"@search.features": {
177+
"Description": {
178+
"uniqueTokenMatches": 2.0,
179+
"similarityScore": 3.0860272,
180+
"termFrequency": 2.0
181+
}
182+
},
183+
"HotelName": "Downtown Mix Hotel",
184+
"Description": "Mix and mingle in the heart of the city. Shop and dine, mix and mingle in the heart of downtown, where fab lake views unite with a cheeky design.",
185+
"Tags": [
186+
"air conditioning",
187+
"laundry service",
188+
"free wifi"
189+
]
190+
},
191+
{
192+
"@search.score": 2.7294855,
193+
"@search.features": {
194+
"Description": {
195+
"uniqueTokenMatches": 1.0,
196+
"similarityScore": 1.6023184,
197+
"termFrequency": 1.0
155198
},
156-
"title": {
157-
"uniqueTokenMatches": 3.0,
158-
"similarityScore": 1.75451557,
159-
"termFrequency" : 6
199+
"Tags": {
200+
"uniqueTokenMatches": 1.0,
201+
"similarityScore": 1.1271671,
202+
"termFrequency": 1.0
160203
}
204+
},
205+
"HotelName": "Ocean Water Resort & Spa",
206+
"Description": "New Luxury Hotel for the vacation of a lifetime. Bay views from every room, location near the pier, rooftop pool, waterfront dining & more.",
207+
"Tags": [
208+
"view",
209+
"pool",
210+
"restaurant"
211+
]
161212
}
162-
}
163-
]
213+
]
164214
```
165215

166216
You can consume these data points in [custom scoring solutions](https://github.com/Azure-Samples/search-ranking-tutorial) or use the information to debug search relevance problems.
167217

168-
The featuresMode parameter isn't documented in the REST APIs, but you can use it on a preview REST API call to Search Documents for text (Keyword) search that's BM25-ranked.
169-
170218
## Number of ranked results in a full text query response
171219

172220
By default, if you aren't using pagination, the search engine returns the top 50 highest ranking matches for full text search. You can use the `top` parameter to return a smaller or larger number of items (up to 1,000 in a single response). You can use `skip` and `next` to page results. Paging determines the number of results on each logical page and supports content navigation. For more information, see [Shape search results](search-pagination-page-layout.md).

0 commit comments

Comments
 (0)