Search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues

I am trying to set up a refinement list in instantsearch, with the ability to filter the refinement list with text input. I have done this in the past with instantsearch.js very easily. I’m pretty new to Vue.

I keep getting this error whenever a key is pressed into the filter input above the refinement list. Needless to say, it doesn’t apply the filter.

Error: search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues
    at AlgoliaSearchHelper.searchForFacetValues (algoliasearch.helper.js:302)
    at AlgoliaSearchHelper.helper.searchForFacetValues (index.js:377)

Config is like so:
image

The Designer facet is set to “searchable” within the Algolia admin dashboard.

Any ideas why this might be happening?

Using Vue Instantsearch 3.

TIA
Baz

could you tell me which value you passed for search-client to the ais-instant-search?

@haroen I’m picking up from someone else’s code… but this is what we have:

:search-client="searchClient"

and

const searchClient = {
  search: function(requests) {
    return algoliaClient.search(requests);
  },
};

Thanks

As the error message is saying, your code is missing searchForFacetValues. You can avoid that in two ways:

const searchClient = {
  search: function(requests) {
    return algoliaClient.search(requests);
  },
  searchForFacetValues: function(requests) {
    return algoliaClient.searchForFacetValues(requests);
  },
};

Or the more efficient way, where you can’t get missing keys:

const searchClient = Object.assign(algoliaClient, {
  search: function(requests) {
    return algoliaClient.search(requests);
  },
});

Thanks @haroen - The first method worked :slight_smile: