Announcement Announcement Module
No announcement yet.
Solr Data faceted query Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Solr Data faceted query


    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 appingSolrEntityInformation.<init>(MappingSolrEnti
    at appingSolrEntityInformation.<init>(MappingSolrEnti
    at olrEntityInformationCreatorImpl.getEntityInformati on(
    at rQueryMethod.<init>(

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


  • #2
    Hi Leo,
    by default SolrQueryLookupStrategy uses @Query to determine whether to derive the query from method name or not. Unfortunately I do not see a way arround this at this time. But feel free to make a proposal and or open a pull request. Maybe we'll come up with some feasable solution.

    Cheers Christoph