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

Inconsistencies with SolrTemplate with Multiple Cores

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Works as Designed
    • Affects Version/s: 2.1.4 (Ingalls SR4)
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      This issue may be the inverse of https://jira.spring.io/browse/DATASOLR-325 . It seems there is inconsistency in how SolrTemplate handles the default core passed in via the constructor. For example line 960:

      queryForTermsPage(TermsQuery query)
      

      ends up calling line 978:

      queryForTermsPage(null, query, method);
      

      With a null core name. However on line 969 the

      queryForObject(Query query, Class<T> clazz) 
      

      will call line 978

      return queryForObject(getSolrCoreOrBeanCollection(clazz), query, clazz, method);
      

      to find the default core passed in via the constructor (or the core name from the clazz):

      return StringUtils.hasText(solrCore) ? solrCore : mappingContext.getPersistentEntity(clazz).getSolrCoreName();
      

      Depending on how the template is configured then, when executing a queryForTermsPage we must pass the core name but when using queryForObject the constructor default core name will be used. It is not consistent. My preference would be for all methods use the core name from the constructor unless the version of the method which contains the core name is used.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cstrobl Christoph Strobl
              Reporter:
              cvelo99@gmail.com Chris Carcel
              Last updater:
              Christoph Strobl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: