Skip to content

Commit 8cf2eb2

Browse files
authored
Update search-indexer-field-mappings.md
Add fixedLengthEncode function, which solves the issue that long document keys cause errors during indexing.
1 parent abd28b0 commit 8cf2eb2

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,24 @@ When you retrieve the encoded key at search time, you can then use the `urlDecod
290290
"name" : "urlDecode"
291291
}
292292
}]
293-
```
293+
```
294+
295+
### fixedLengthEncode function
296+
297+
This function converts a string of any length to a fixed length string.
298+
299+
### Example - map document keys that are too long
300+
301+
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.
302+
303+
```JSON
304+
305+
"fieldMappings" : [
306+
{
307+
"sourceFieldName" : "metadata_storage_path",
308+
"targetFieldName" : <your key field>,
309+
"mappingFunction" : {
310+
"name" : "fixedLengthEncode"
311+
}
312+
}]
313+
```

0 commit comments

Comments
 (0)