Details

      Description

      Hi,

      I am trying to use faceted search with a custom repository as follows:

      Repository:
      public interface POISearchRepository extends CustomSolrRepository, SolrCrudRepository<POISearch, String>

      Custom interface:
      public interface CustomSolrRepository {

      FacetPage<POISearch> facetSearch(String location, String categories, String duration, Pageable page) throws Exception;
      }

      Custom impl:

      @Repository
      public class POISearchImpl implements CustomSolrRepository {

      @Resource
      private SolrTemplate solrTemplate;

      @Override
      public FacetPage<POISearch> facetSearch(String location, String categories, String duration, Pageable page) throws Exception {

      ......

      Unfortunately, I keep getting the following exception:

      Caused by: org.springframework.data.mapping.PropertyReferenceException: No property facet found for type com.example.domain.POISearch
      at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:353)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307)
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:271)
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:245)
      at org.springframework.data.repository.query.parser.Part.<init>(Part.java:72)
      at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:180)
      at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260)
      at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:240)
      at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:68)
      at org.springframework.data.solr.repository.query.PartTreeSolrQuery.<init>(PartTreeSolrQuery.java:36)
      at org.springframework.data.solr.repository.support.SolrRepositoryFactory$SolrQueryLookupStrategy.resolveQuery(SolrRepositoryFactory.java:101)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:279)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:147)
      at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:153)
      at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:43)
      at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
      ... 57 more

      It seems like the repository tries to resolve the custom method and that causes the exception (changing the method names shows that)

        Attachments

          Activity

            People

            • Assignee:
              cstrobl Christoph Strobl
              Reporter:
              checklist Assaf
              Last updater:
              Trevor Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: