unretrievableAttributes
[]
(no attribute is unretrievable)
'unretrievableAttributes' => [ 'attribute' ]
Can be used in these methods:
setSettings
set_settings
setSettings
set_settings
setSettings
setSettings
SetSettings
setSettings
SetSettings
setSettings
About this parameter
List of attributes you don’t want the engine to retrieve at query time.
Preventing particular attributes from being retrieved may be particularly important for security or business reasons. Some attributes may be helpful for ranking or other technical purposes but should never be seen by your users, for example, total sales, permissions, and other private information. This setting guarantees this. Attribute names are case-sensitive.
There’s no limit to the number of attributes in the list, but having many attributes slows down calls to getSettings
. This can make the Algolia dashboard slower and less responsive.
Usage notes
This setting is ignored if the query is authenticated with the admin API key.
Examples
Make some attributes unretrievable
1
2
3
4
5
$index->setSettings([
'unretrievableAttributes' => [
'total_number_of_sales'
]
]);