[TYPO3-english] Solr faceting and categories: restrict results per (set of) category

Jigal van Hemert jigal.van.hemert at typo3.org
Sun Nov 1 13:34:27 CET 2015


Hi,

On 01/11/2015 10:13, Bert Hiddink [BENDOO e-work solutions] wrote:
> I have succesfully set up Solr with categories/faceting thanks to this
> article of Steffen Ritter:
> http://blog.steffen-ritter.net/2014/04/extsolr-use-categories-as-hierarchical-facets/
>
>
> However, now I want to restrict the rendering of the results to a
> specific set of categories, depending on the page where the searchbox is
> placed.
>
> How could I restrict the rendering of categories in the case of
> "type=hierarchy")?

The categories are properties of the solr documents in the result set. 
The facets that are rendered simply reflect the categories that are 
present in the result set.
By saying that you want to restrict the displayed set of categories I 
assume that you actually want to restrict the result set (depending on 
the page where the search box is placed)?

The solr plugin provides some options to set for example a filter query. 
If you e.g. want to restrict the items to one top level category you 
could put the top level category/categories in a field in the index and 
put a filter query for that category in the plugin configuration (or do 
it with TypoScript, perhaps using some data depending on the page and 
make it work automatically).
As a side effect the search result would be limited to items with those 
categories and the facet automatically only shows the categories you want.

-- 
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-english mailing list