Uploaded image for project: 'Spring Data for Apache Solr'
  1. Spring Data for Apache Solr
  2. DATASOLR-581

Graph Query not supported in spring-data-solr

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Repository
    • Labels:
      None

      Description

      Named query feature with graph query is supported in solrJ.

      The spring data solr uses the solrJ library under the hood. I am not sure why I am getting the below exception while using spring data solr. The solrJ implementation works fine

      Query Working in SolrJ Working in Spring-Data-Solr
      {!graph from=id to=parentCategory maxDepth=8 sort="level asc" rows=9999 returnRoot=false}

      id:

      Yes No

       

       

      HttpSolrClient from solrJ is being used in the connection configuration

      @Configuration @EnableSolrRepositories( basePackages = "com.x.x.x.repository", namedQueriesLocation = "classpath:solr-named-queries.properties") @ComponentScan public class SolrConfig { @Value("${spring.data.solr.host}") String solrURL; @Bean public SolrClient solrClient() { return new HttpSolrClient.Builder(solrURL).build(); } @Bean public SolrTemplate solrTemplate(SolrClient client) throws Exception { return new SolrTemplate(client); } }
      

       

       

      Exception:

      2020-05-13 00:10:23.289 ERROR 40667 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Error from server at http://<solrserverURL>:8983/solr: org.apache.solr.search.SyntaxError: Cannot parse 'id:': Encountered "<EOF>" at line 1, column 3.Was expecting one of: <BAREOPER> ... "(" ... "*" ... <QUOTED> ... <TERM> ... <PREFIXTERM> ... <WILDTERM> ... <REGEXPTERM> ...
      

      System Specification

      id 'org.springframework.boot' version '2.2.7.RELEASE'
      implementation 'org.springframework.boot:spring-boot-starter-data-solr'
      

       

      Steps to replicate

       

      Are we missing something here or the support for graph query is missing from spring data solr?

        Attachments

          Activity

            People

            Assignee:
            cstrobl Christoph Strobl
            Reporter:
            subhopam Subhopam Das
            Last updater:
            Subhopam Das
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: