lizzie
lizzie

Reputation: 1656

Pivot faceting with Spring-data-solr using SolrTemplate

How is it possible to add a facet pivot using solrTemplate with spring-solr-data?

This question is related to How to facet.pivot with spring-data-solr but I am looking for a solution using solrTemplate.

Upvotes: 2

Views: 818

Answers (1)

Christoph Strobl
Christoph Strobl

Reputation: 6736

Please have a look at ITestSolrTemplate.java#L451.

FacetQuery query = new SimpleFacetQuery(new Criteria("*").expression("*"));
query.setFacetOptions(new FacetOptions().addFacetOnPivot("category", "name"));

FacetPage<SolrBean> page = solrTemplate.queryForFacetPage(query, SolrBean.class);

Upvotes: 4

Related Questions