How to integrate a facetted search
-
How can I enable facetted search with this plugin. I have read the documentation at
https://github.com/parisholley/wordpress-fantastic-elasticsearch/wiki/Faceted-Searchand I understand the concepts behind passing a query with es containing the facets to filter on. However when I pass a url with es parameter set through elasticsearch\Faceting::urlAdd or formed manually the results returned are not filtered on the facets e.g.
?s=cats&es[category][and][]=vets
and the query
?s=cats&es[category][and][]=management
return the same results so the facet search is having no effect
however I can see that the facets are being correctly indexed when I run the following code on the same page
$search = 'cat'; $facets = elasticsearch\Faceting::all(); $facets = array('category'); $return = elasticsearch\Searcher::search($search, 0, 10, $facets , false);
because the return array contains counts for the matches within each
facet.This is a gap in the documentation and not a bug – but make use for facets impossible.
https://www.ads-software.com/plugins/fantastic-elasticsearch/
- The topic ‘How to integrate a facetted search’ is closed to new replies.