Closed Guillaume-Developer closed 9 months ago
Sorry, it was actually a non-issue. It is possible to do what I wanted by modifying the display of the filtered item to include the name of the Heatmap in it and then use the code below.
this.clearFilters = new Action({
text:"Clear Filters",
action: () => {
if (!this.searchService.query.filters) return;
for (const filter of this.getHeatmapFilters(this.searchService.query.filters)) this.searchService.query.removeSameFilters(filter);
this.searchService.search();
}
})
private getHeatmapFilters(filters: Filter) {
const heatmapFilters: Filter[] = [];
if (isExprFilter(filters) && !filters.display) {
for (const filter of filters.filters) {
const heatmapFilter = this.getHeatmapFilters(filter);
heatmapFilters.push(...heatmapFilter);
}
}
else if (isExprFilter(filters) && filters.display?.startsWith(this._name)) heatmapFilters.push(filters);
return heatmapFilters;
}
Context
We are currently upgrading an application from v11.9.0 to v11.10.0 and we are using the FacetHeatmapComponent.
Description
In previous versions, we had the possibility to clear the filters of a specific facet by using its name, using the
Query
methodremoveSelect
. In the newest version, it seems that the filter syntax only uses the fields to distinguish between filters and the use of the facet name to clear filters is not longer feasible. This change makes us unable to clear filters from the Facet Heatmap like we would be able to do on any other facets. It also makes us unable to fetch the specific Heatmap filters and differentiate them from other facets. Do you have an idea how we could implement it in the newest version?Previous implementation