API Reference / API Parameters / userData
Type: Object
Engine default:
Parameter syntax
'userData' => array

Can be used in these methods:

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 the getSettings method.

Examples

Set userDatas

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?