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
The v3.1 REST API combines the analysis operations for layout analysis, prebuilt models, and custom models into a single pair of operations by assigning **`documentModels`** and **`modelId`** to the layout analysis(../prebuilt-layout) and prebuilt models.
134
+
The v3.1 REST API combines the analysis operations for layout analysis, prebuilt models, and custom models into a single pair of operations by assigning **`documentModels`** and **`modelId`** to the [layout analysis](../prebuilt/layout.md) and prebuilt models.
:::image type="content" source="media/cognitive-search-output-field-mapping/indexer-stages-output-field-mapping.png" alt-text="Diagram of the Indexer Stages with Output Field Mappings highlighted.":::
17
17
18
18
This article explains how to set up *output field mappings*, defining a data path between in-memory data generated during [skillset processing](cognitive-search-concept-intro.md), and target fields in a search index. During indexer execution, skills-generated information exists in memory only. To persist this information in a search index, you need to tell the indexer where to send the data.
19
19
@@ -35,14 +35,14 @@ In contrast with a [`fieldMappings`](search-indexer-field-mappings.md) definitio
35
35
36
36
- Indexer, index, data source, and skillset.
37
37
38
-
- Index fields must be simple or top-level fields. You can't output to a [complex type](search-howto-complex-data-types.md), but if you have a complex type, you can use an output field definition to flatten parts of the complex type and send them to a collection in a search index.
38
+
- Index fields must be simple or top-level fields. You can't output to a [complex type](search-howto-complex-data-types.md). However, if you have a complex type, you can use an output field definition to flatten parts of the complex type and send them to a collection in a search index.
39
39
40
40
## When to use an output field mapping
41
41
42
42
Output field mappings are required if your indexer has an attached [skillset](cognitive-search-working-with-skillsets.md) that creates new information that you want in your index. Examples include:
43
43
44
44
- Vectors from embedding skills
45
-
- OCR text from image skills
45
+
-Optical character recognition (OCR) text from image skills
46
46
- Locations, organizations, or people from entity recognition skills
47
47
48
48
Output field mappings can also be used to:
@@ -95,13 +95,13 @@ You can use the REST API or an Azure SDK to define output field mappings.
95
95
96
96
| Property | Description |
97
97
|----------|-------------|
98
-
| sourceFieldName | Required. Specifies a path to enriched content. An example might be `/document/content`. See [Reference enrichments in an Azure AI Search skillset](cognitive-search-concept-annotations-syntax.md) for path syntax and examples. |
98
+
| sourceFieldName | Required. Specifies a path to enriched content. An example might be */document/content*. See [Reference enrichments in an Azure AI Search skillset](cognitive-search-concept-annotations-syntax.md) for path syntax and examples. |
99
99
| targetFieldName | Optional. Specifies the search field that receives the enriched content. Target fields must be top-level simple fields or collections. It can't be a path to a subfield in a complex type. If you want to retrieve specific nodes in a complex structure, you can [flatten individual nodes](#flattening-information-from-complex-types) in memory, and then send the output to a string collection in your index. |
100
100
| mappingFunction | Optional. Adds extra processing provided by [mapping functions](search-indexer-field-mappings.md#mappingFunctions) supported by indexers. For enrichment nodes, encoding and decoding are the most commonly used functions. |
101
101
102
102
1. The `targetFieldName` is always the name of the field in the search index.
103
103
104
-
1. The `sourceFieldName` is a path to a node in the enriched document. It's the output of a skill. The path always starts with `/document`, and if you're indexing from a blob, the second element of the path is `/content`. The third element is the value produced by the skill. For more information and examples, see [Reference enrichments in an Azure AI Search skillset](cognitive-search-concept-annotations-syntax.md).
104
+
1. The `sourceFieldName` is a path to a node in the enriched document. It's the output of a skill. The path always starts with */document*, and if you're indexing from a blob, the second element of the path is */content*. The third element is the value produced by the skill. For more information and examples, see [Reference enrichments in an Azure AI Search skillset](cognitive-search-concept-annotations-syntax.md).
105
105
106
106
This example adds entities and sentiment labels extracted from a blob's content property to fields in a search index.
107
107
@@ -136,7 +136,7 @@ You can use the REST API or an Azure SDK to define output field mappings.
136
136
137
137
### [**.NET SDK (C#)**](#tab/csharp)
138
138
139
-
In the Azure SDK for .NET, use the [OutputFieldMappingEntry](/dotnet/api/azure.search.documents.indexes.models.outputfieldmappingentry) class that provides "Name" and "TargetFieldName" properties and an optional "MappingFunction" reference.
139
+
In the Azure SDK for .NET, use the [OutputFieldMappingEntry](/dotnet/api/azure.search.documents.indexes.models.outputfieldmappingentry) class that provides `Name` and `TargetFieldName` properties and an optional `MappingFunction` reference.
140
140
141
141
Specify output field mappings when constructing the indexer, or later by directly setting [SearchIndexer.OutputFieldMappings](/dotnet/api/azure.search.documents.indexes.models.searchindexer.outputfieldmappings). The following C# example sets the output field mappings when constructing an indexer.
142
142
@@ -177,7 +177,7 @@ Assume a skillset that generates embeddings for a vector field, and an index tha
177
177
]
178
178
```
179
179
180
-
The source field path is skill output. In this example, the output is `text_vector`. Target name is an optional property. If you don't give the output mapping a target name, the path would be `embedding` or more precisely, `/document/content/embedding`.
180
+
The source field path is skill output. In this example, the output is *text_vector*. Target name is an optional property. If you don't give the output mapping a target name, the path would be *embedding* or more precisely, */document/content/embedding*.
181
181
182
182
```json
183
183
{
@@ -254,7 +254,7 @@ Here's an example of a document in Azure Cosmos DB with nested JSON:
254
254
}
255
255
```
256
256
257
-
If you wanted to fully index the above source document, you'd create an index definition where the field names, levels, and types are reflected as a complex type. Because field mappings aren't supported for complex types in the search index, your index definition must mirror the source document.
257
+
If you wanted to fully index this source document, you'd create an index definition where the field names, levels, and types are reflected as a complex type. Because field mappings aren't supported for complex types in the search index, your index definition must mirror the source document.
258
258
259
259
```json
260
260
{
@@ -283,7 +283,7 @@ If you wanted to fully index the above source document, you'd create an index de
283
283
}
284
284
```
285
285
286
-
Here's a sample indexer definition that executes the import (notice there are no field mappings and no skillset).
286
+
Here's a sample indexer definition that executes the import. Notice there are no field mappings and no skillset.
287
287
288
288
```json
289
289
{
@@ -304,7 +304,7 @@ The result is the following sample search document, similar to the original in A
304
304
"value": [
305
305
{
306
306
"@search.score": 1,
307
-
"id": "240a98f5-90c9-406b-a8c8-f50ff86f116c",
307
+
"id": "11bb11bb-cc22-dd33-ee44-55ff55ff55ff",
308
308
"palette": "primary colors",
309
309
"colors": [
310
310
{
@@ -338,9 +338,9 @@ The result is the following sample search document, similar to the original in A
338
338
339
339
An alternative rendering in a search index is to flatten individual nodes in the source's nested structure into a string collection in a search index.
340
340
341
-
To accomplish this task, you'll need an `outputFieldMappings` that maps an in-memory node to a string collection in the index. Although output field mappings primarily apply to skill outputs, you can also use them to address nodes after ["document cracking"](search-indexer-overview.md#stage-1-document-cracking) where the indexer opens a source document and reads it into memory.
341
+
To accomplish this task, you'll need an `outputFieldMappings` that maps an in-memory node to a string collection in the index. Although output field mappings primarily apply to skill outputs, you can also use them to address nodes after [document cracking](search-indexer-overview.md#stage-1-document-cracking) where the indexer opens a source document and reads it into memory.
342
342
343
-
Below is a sample index definition, using string collections to receive flattened output:
343
+
The following sample index definition uses string collections to receive flattened output:
344
344
345
345
```json
346
346
{
@@ -378,14 +378,14 @@ Here's the sample indexer definition, using `outputFieldMappings` to associate t
378
378
}
379
379
```
380
380
381
-
Results from the above definition are as follows. Simplifying the structure loses context in this case. There's no longer any associations between a given color and the mediums it's available in. However, depending on your scenario, a result similar to the one shown below might be exactly what you need.
381
+
Results from the definition are as follows. Simplifying the structure loses context in this case. There's no longer any associations between a given color and the mediums it's available in. However, depending on your scenario, a result similar to the following example might be exactly what you need.
382
382
383
383
```json
384
384
{
385
385
"value": [
386
386
{
387
387
"@search.score": 1,
388
-
"id": "240a98f5-90c9-406b-a8c8-f50ff86f116c",
388
+
"id": "11bb11bb-cc22-dd33-ee44-55ff55ff55ff",
389
389
"palette": "primary colors",
390
390
"color_names": [
391
391
"blue",
@@ -402,8 +402,8 @@ Results from the above definition are as follows. Simplifying the structure lose
402
402
}
403
403
```
404
404
405
-
## See also
405
+
## Related content
406
406
407
-
+[Define field mappings in a search indexer](search-indexer-field-mappings.md)
407
+
+[Field mappings and transformations](search-indexer-field-mappings.md)
0 commit comments