Hello Yext community,
I’m currently working on a project that involves utilizing Yext Pages and Search UI. I’ve successfully implemented the logic to extract search parameters from the URL, which works well for query, sorting, pagination, and offset functionalities. However, I’ve encountered an issue when attempting to work with facets.
For instance, take this URL as an example: verticalKey=healthcare_professionals&facets=%7B"address.city"%3A%5B"Shreveport"%5D%2C"gender"%3A%5B"Male"%5D%
Upon parsing the URL, the facets appear as an array. Therefore, I’ve attempted to loop through them using the following JavaScript code:
if (facetsParsed) {
facetsParsed.forEach((facet) => {
searchActions.setFacetOption(
facet.fieldId,
{ matcher: Matcher.Equals, value: facet.value },
facet.selected
)
})
}
searchActions.executeVerticalQuery()
Unfortunately, this approach doesn’t work, and I haven’t received any error notifications or indications from Yext regarding the issue. Would you happen to have any suggestions or ideas on how to properly handle this?