Quantcast
Viewing all articles
Browse latest Browse all 128

Solr Data faceted query

Hi!

Please suggest a better place to ask Spring Data Solr related questions if it's not this one. Thank you.

Basically I am wondering if there is a way to specify a faceted query without providing @Query annotation.

It may result in solr url something like: /solr/select/?facet=true&facet.field=fashion_section_url_label

Currently if I use:

public interface SolrProductRepository extends SolrCrudRepository<Product, String> {
@Facet(fields = { "section_url_label", "l2_facets", "l3_facets" }, minCount = 1)
public FacetPage findFacetOnSection(Pageable page);
}

i get an Exception like:

Caused by: java.lang.NullPointerException
at org.springframework.data.solr.repository.support.M appingSolrEntityInformation.<init>(MappingSolrEnti tyInformation.java:44)
at org.springframework.data.solr.repository.support.M appingSolrEntityInformation.<init>(MappingSolrEnti tyInformation.java:40)
at org.springframework.data.solr.repository.support.S olrEntityInformationCreatorImpl.getEntityInformati on(SolrEntityInformationCreatorImpl.java:46)
at org.springframework.data.solr.repository.query.Sol rQueryMethod.<init>(SolrQueryMethod.java:49)

So i am forced to use @Query("*:*") along with @Facet annotation. Is there a way to avoid that?

Leo

Viewing all articles
Browse latest Browse all 128

Trending Articles