Question

When declaring this method:

@Query(value = "*:*")
@Facet(pivotFields = {"type","status"}, limit = 10000)
FacetPage<SolrCrimeServer> findAllAndFacetOnTypeAndStatus(Pageable page);

I get

java.lang.IllegalStateException: 2 or more fields required for pivot facets at org.springframework.util.Assert.state(Assert.java:385) at org.springframework.data.solr.core.query.FacetOptions.addFacetOnPivot(FacetOptions.java:150) at org.springframework.data.solr.repository.query.AbstractSolrQuery.extractFacetOptions(AbstractSolrQuery.java:246) at org.springframework.data.solr.repository.query.AbstractSolrQuery.execute(AbstractSolrQuery.java:120)

With version

1.1.1.RELEASE

Thanks.

Was it helpful?

Solution

The pivotFields attribute of @Facet takes at least a tuple of field names within one argument.

@Facet(pivotFields={"type,status"}, limit=10000)

You can have a look at SolrQueryMethodTests. Additionally you may vote for this issue.

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