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/search-indexer-field-mappings.md
+18-19Lines changed: 18 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,17 +24,14 @@ Field mappings can also be used for light-weight data conversions, such as encod
24
24
25
25
Field mappings apply to:
26
26
27
-
+ Physical data structures on both sides of the data stream (between fields in a [supported data source](search-indexer-overview.md#supported-data-sources) and fields in a [search index](search-what-is-an-index.md)).
27
+
+ Physical data structures on both sides of the data path (source fields in a [supported data source](search-indexer-overview.md#supported-data-sources) and target fields in a [search index](search-what-is-an-index.md)).
28
28
29
-
If you're importing skill-generated content that resides in memory, use[outputFieldMappings](cognitive-search-output-field-mapping.md) to map in-memory nodes to output fields in a search index.
29
+
Logical data structures created by skills reside only in memory. Use[outputFieldMappings](cognitive-search-output-field-mapping.md) to map in-memory nodes to output fields in a search index.
30
30
31
-
+ Search indexes only. If you're populating a [knowledge store](knowledge-store-concept-intro.md), use [projections](knowledge-store-projections-examples.md) for data path configuration.
31
+
+ Search indexes only. To populate a [knowledge store](knowledge-store-concept-intro.md), use [projections](knowledge-store-projections-examples.md) for data path configuration.
32
32
33
33
+ Top-level search fields only, where the `targetFieldName` is either a simple field or a collection. A target field can't be a complex type.
34
34
35
-
> [!NOTE]
36
-
> If you're working with complex data (nested or hierarchical structures), and you'd like to mirror that data structure in your search index, your search index must match the source structure exactly (same field names, levels, and types) so that the default mappings will work. Optionally, you might want just a few nodes in the complex structure. To get individual nodes, you can flatten incoming data into a string collection (see [outputFieldMappings](cognitive-search-output-field-mapping.md#flatten-complex-structures-into-a-string-collection) for this workaround).
37
-
38
35
## Supported scenarios
39
36
40
37
| Use-case | Description |
@@ -45,6 +42,13 @@ Field mappings apply to:
45
42
| Encoding and decoding | You can apply [mapping functions](#mappingFunctions) to support Base64 encoding or decoding of data during indexing. |
46
43
| Split strings or recast arrays into collections | You can apply [mapping functions](#mappingFunctions) to split a string that includes a delimiter, or to send a JSON array to a search field of type `Collection(Edm.String)`.
47
44
45
+
> [!NOTE]
46
+
> If no field mappings are present, indexers assume data source fields should be mapped to index fields with the same name. Adding a field mapping overrides the default field mappings for the source and target field. Some indexers, such as the [blob storage indexer](search-howto-indexing-azure-blob-storage.md), add default field mappings for the index key field automatically.
47
+
48
+
Complex fields aren't supported in a field mapping. Your source structure (nested or hierarchical structures) must exactly match the complex type in the index so that the default mappings work. For more information, see [Tutorial: Index nested JSON blobs](search-semi-structured-data.md) for an example. If you get an error similar to `"Field mapping specifies target field 'Address/city' that doesn't exist in the index"`, it's because target field mappings can't be a complex type.
49
+
50
+
Optionally, you might want just a few nodes in the complex structure. To get individual nodes, you can flatten incoming data into a string collection (see [outputFieldMappings](cognitive-search-output-field-mapping.md#flatten-complex-structures-into-a-string-collection) for this workaround).
51
+
48
52
## Define a field mapping
49
53
50
54
This section explains how to set up field mappings.
@@ -79,23 +83,18 @@ This section explains how to set up field mappings.
79
83
]
80
84
```
81
85
82
-
| Property | Description |
83
-
|----------|-------------|
84
-
| sourceFieldName | Required. Represents a field in your data source. |
85
-
| targetFieldName | Optional. Represents a field in your search index. If omitted, the value of `sourceFieldName` is assumed for the target. Target fields must be top-level simple fields or collections. It can't be a complex type or collection. If you're handling a data type issue, a field's data type is specified in the index definition. The field mapping just needs to have the field's name.|
86
-
| mappingFunction | Optional. Consists of [predefined functions](#mappingFunctions) that transform data. |
87
-
88
-
If you get an error similar to `"Field mapping specifies target field 'Address/city' that doesn't exist in the index"`, it's because target field mappings can't be a complex type. The workaround is to create an index schema that's identical to the raw content for field names and data types. See [Tutorial: Index nested JSON blobs](search-semi-structured-data.md) for an example.
89
-
90
-
Azure AI Search uses case-insensitive comparison to resolve the field and function names in field mappings. This is convenient (you don't have to get all the casing right), but it means that your data source or index can't have fields that differ only by case.
91
-
92
-
> [!NOTE]
93
-
> If no field mappings are present, indexers assume data source fields should be mapped to index fields with the same name. Adding a field mapping overrides the default field mappings for the source and target field. Some indexers, such as the [blob storage indexer](search-howto-indexing-azure-blob-storage.md), add default field mappings for the index key field.
86
+
| Property | Description |
87
+
|----------|-------------|
88
+
| sourceFieldName | Required. Represents a field in your data source. |
89
+
| targetFieldName | Optional. Represents a field in your search index. If omitted, the value of `sourceFieldName` is assumed for the target. Target fields must be top-level simple fields or collections. It can't be a complex type or collection. If you're handling a data type issue, a field's data type is specified in the index definition. The field mapping just needs to have the field's name.|
90
+
| mappingFunction | Optional. Consists of [predefined functions](#mappingFunctions) that transform data. |
94
91
95
92
#### Example: Name or type discrepancy
96
93
97
94
An explicit field mapping establishes a data path for cases where name and type aren't identical.
98
95
96
+
Azure AI Search uses case-insensitive comparison to resolve the field and function names in field mappings. This is convenient (you don't have to get all the casing right), but it means that your data source or index can't have fields that differ only by case.
97
+
99
98
```JSON
100
99
PUT https://[service name].search.windows.net/indexers/myindexer?api-version=[api-version]
101
100
Content-Type: application/json
@@ -162,7 +161,7 @@ Note that these functions are exclusively supported for parent indexes at this t
162
161
163
162
<aname="base64EncodeFunction"></a>
164
163
165
-
### base64Encode function and examples
164
+
### base64Encode function
166
165
167
166
Performs *URL-safe* Base64 encoding of the input string. Assumes that the input is UTF-8 encoded.
0 commit comments