Question

I would like to have some kind of category tree next to my Solr search results. The basic way is simple (doing it in two separated queries). But what about the expert way ;) Is there a possibility to retrieve this kind of information for all results and not only the returned results within a single query (the main query)?

Currently I query in the first place for the results (standard limit) with all required fields I like to display. In the second place I query results with the same query for only channel and category and limit set to max int (which mostly gives me all product channes and categories). When I am using Solr's facet functionality I do not have the relation between channel and category.

Minimal example schema:

<fields>
    <field name="channel" type="string" indexed="true" stored="true" />
    <field name="category" type="string" indexed="true" stored="true" />
</fields>

Desired presentation on website:

Desired category tree

Was it helpful?

Solution

I think you can get that with pivot facets. The only thing you need to calculate for yourself is the 'All from third Channel' sum.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top