I’m using the InstantSearch.js adapter library, an...
# community-help
t
I’m using the InstantSearch.js adapter library, and currently experimenting with the
instantsearch.widgets.dynamicWidgets
module to automatically generate search filter panels. However, I have a couple values that I’m faceting on in the background with Scoped API Keys, and I don’t want these facets to show up on the frontend. Is there a way to exclude facets from being returned in the
facet_counts
payload, or do I need to just filter out these facets in my frontend code?
I thought the
exclude_fields
option would exclude these values from the facets as well, but that doesn’t appear to be the case.
j
I have a couple values that I’m faceting on in the background with Scoped API Keys, and I don’t want these facets to show up on the frontend.
Could you elaborate on why you're faceting on them, if you don't want facet counts? Couldn't you remove those fields from facet_by, or if it's just a few values from the field you don't want to return, could you not add that to the embedded filter inside the scoped API key?
exclude_fields
only controls the fields inside the
document
API response
t
I’m working with an index of products, and I want certain products to only be visible to certain customer types. > could you not add that to the embedded filter inside the scoped API key? This is indeed what I am doing, I’m not using
facet_by
on the frontend, just but if I drop the field from my collection settings I get this error, which implies that faceting must be turned on even for an embedded filter:
Copy code
Could not find a filter field named `product_availability.preferred` in the schema
Ahhh, I just discovered that a field only needs to be indexed for filtering to work, and can have “facet” set to false. Things are working correctly now. Thanks for giving me the prompt to look through this again!
👍 1