API Reference
/
API Parameters
/
userData
Nov. 25, 2021
userData
Type: Object
Engine default:
Parameter syntax
'userData' => array
Can be used in these methods:
setSettings
set_settings
setSettings
set_settings
setSettings
setSettings
SetSettings
setSettings
SetSettings
setSettings
About this parameter
Lets you store custom data in your indices.
Usage notes
- The value you pass will be converted into a
JSONObject
. You can store any value that can be converted.
Do not store more than 32 KB: if you try to store more your search will stop working properly.
- To access the
userData
you stored, you can use thegetSettings
method.
Examples
Set userDatas
Copy
1
2
3
4
5
$index->setSettings([
'userData' => [
'extraData' => 'This is the custom data that you want to store in your index',
]
]);
Did you find this page helpful?