Set attribute searchable in attributesForFacetting

searchforfacetvalue
#1

Hello,

In order to use refinementsList searchable option (as below):
59

To enable this feature, according to the doc, I must set an attribute as searchable in attributesForFacetting.

So, here is the array passed to the setSettings function (I use algoliasearch-client-php):

[
    'searchableAttributes' => [
        'name',
        'reference',
        etc...
    ],
    'attributesForFaceting' => [
        'hierarchicalCategories',
        etc...,
        'searchable(id_f_3)'
    ],
    'attributesToRetrieve' => [
        'objectID',
        'name',
        'reference',
        etc...
    ],
    'hitsPerPage' => 20
]

The problem: the API return a 400 and tell me that there is an error in the request near the “searchable(id_f_3)”

What is wrong ? Do you have an idea ?

Thank for the help!

#2

Hey there, we need to see your data so I am reaching out directly via email and will report anything here when relevant

1 Like
#3

Fixed !

My settings array which was poorly formatted. I fix it by rebuild the entire array in my PHP script.

Thanks a lot for the help !
Great support.

1 Like