Reputation: 117
When I try to use
restrictSearchableAttributes
using the Javascript client
I get
Invalid setting for restrictSearchableAttributes, attribute "field" is not in attributesToIndex
But I'm saving using the Laravel package and I already set the field for attributesToIndex there?
Upvotes: 3
Views: 1327
Reputation: 2319
The restrictSearchableAttributes
can only be used to restrict the searchable attributes to a subset of what your index settings describe.
Therefore, you need to ensure that field
is in the attributesToIndex
list (in your index settings) before being able to restrict the search on this attribute.
Upvotes: 2