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

GroupOptions is not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.5.4 (Gosling SR4)
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
    • Environment:
      Windows 7, Spring Tool Suite

      Description

      In order to group results by personId I used the following code

      Criteria cb =   PatientIndexCriteriaBuilder.getCriteriaBuilder(searchCriteria);
      Query search = new SimpleQuery(cb);
      
      Field field = new SimpleField("personId");
      SimpleQuery groupQuery = new SimpleQuery(new SimpleStringCriteria("*:*"));
      GroupOptions groupOptions = new GroupOptions()
      .addGroupByField(field)
      .addGroupByQuery(search);
      groupQuery.setGroupOptions(groupOptions);
      
      GroupPage<PatientIndex> results= solrTemplate.queryForGroupPage(search, PatientIndex.class);
      

      The returning result is not group by the person Id.

      But instead of using groupoptions If I use the following code, The returning data is properly group by the personId.

      Query search = new SimpleQuery(cb);
      search.addGroupByField(field);
      Page<PatientIndex> results = solrOperations.queryForPage(search, PatientIndex.class);
      

        Attachments

          Activity

            People

            Assignee:
            cstrobl Christoph Strobl
            Reporter:
            yogyah Yogya H
            Last updater:
            Partha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: