-
Notifications
You must be signed in to change notification settings - Fork 112
Description
Hi there,
I am doing a a search query with the version 3.4.
On the search query with filters parameter all fine, it retrieves the facet values and here works perfect.
`$vintageProducts = $this->vintageProductSearchableRepository->search($searchStringWithoutIntegers,
function (SearchIndex $algolia, string $query, array $options) use ($requestedUserOrganisation, $visibleDate, $requestedFilterCriteria, $filters, $orderByCustomAttributes,$requestedSearchFacets, $facetFilters)
{
/**
* Facets
*/
$options['facets'] = array_keys(AlgoliaVintageProductAttributeEnum::getFacetsAttributes());
/**
* Filters
*/
if($filters)
{
$options['filters'] = implode(' AND ', $filters);
}
return $algolia->search($query, $options);
}
);`
Although wanted to search on a certain facet so I use the same index but the searchForFacetValues and here I can search on facet values, but I want to pass the current filters so the filter is applied to the index and the facets are filtered also.
For the search parameter I pass the $requestOptions in the second parameter of the search call (return $algolia->search($query, $options)) but for the searchForFacetValues third parameter public function searchForFacetValues($facetName, $facetQuery, $requestOptions = []) this is not working for me.
` $visibleDate = new \DateTime();
$options['filters'] = OfferedVintageProductsFilterHelper::organisationOfferedVintageProductsOfferCriteriaToAlgoliaFilterArray($requestedUserOrganisation->getOrganisation(), $this->request, $visibleDate);
$indexResponse = $index->searchForFacetValues($searchableAlgoliaVintageProductAttributeEnum->value, $searchString, $options);
$responseFacetHits = $indexResponse['facetHits'] ?? [];`
Any idea how to do this?
Kind regards,
Vincent