Skip to content

Commit dd31cf4

Browse files
authored
Merge pull request #50734 from shuyangmsft/patch-2
Update search-indexer-field-mappings.md
2 parents 7f3d200 + efcb2f5 commit dd31cf4

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

articles/search/search-indexer-field-mappings.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure Cognitive Search
44
description: Configure field mappings in an indexer to account for differences in field names and data representations.
55

66
manager: nitinme
7-
author: mgottein
7+
author: mattmsft
88
ms.author: magottei
99
ms.devlang: rest-api
1010
ms.service: cognitive-search
@@ -119,7 +119,7 @@ Performs *URL-safe* Base64 encoding of the input string. Assumes that the input
119119

120120
#### Example - document key lookup
121121

122-
Only URL-safe characters can appear in an Azure Cognitive Search document key (because customers must be able to address the document using the [Lookup API](https://docs.microsoft.com/rest/api/searchservice/lookup-document) ). If the source field for your key contains URL-unsafe characters, you can use the `base64Encode` function to convert it at indexing time.
122+
Only URL-safe characters can appear in an Azure Cognitive Search document key (because customers must be able to address the document using the [Lookup API](https://docs.microsoft.com/rest/api/searchservice/lookup-document) ). If the source field for your key contains URL-unsafe characters, you can use the `base64Encode` function to convert it at indexing time. However, a document key (both before and after conversion) can't be longer than 1,024 characters.
123123

124124
When you retrieve the encoded key at search time, you can then use the `base64Decode` function to get the original key value, and use that to retrieve the source document.
125125

@@ -290,4 +290,26 @@ When you retrieve the encoded key at search time, you can then use the `urlDecod
290290
"name" : "urlDecode"
291291
}
292292
}]
293-
```
293+
```
294+
295+
<a name="fixedLengthEncodeFunction"></a>
296+
297+
### fixedLengthEncode function
298+
299+
This function converts a string of any length to a fixed length string.
300+
301+
### Example - map document keys that are too long
302+
303+
When facing errors complaining about document key being longer than 1024 characters, this function can be applied to reduce the length of the document key.
304+
305+
```JSON
306+
307+
"fieldMappings" : [
308+
{
309+
"sourceFieldName" : "metadata_storage_path",
310+
"targetFieldName" : "your key field",
311+
"mappingFunction" : {
312+
"name" : "fixedLengthEncode"
313+
}
314+
}]
315+
```

0 commit comments

Comments
 (0)