lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Kan <solrexp...@gmail.com>
Subject groups inside groups
Date Thu, 15 Jan 2015 11:14:30 GMT
Hi solr users & developers,

Is it possible to group inside the group? First level is a group query, the
second level is a single value field of each document inside the first
level group with counts.

I.e. the trick is, that the second level should contain facet counts on
values of that single value field.

To illustrate:

First level: query:

Field1:[* TO *] AND Field2:[* TO *]

group.field = UserId

Result:
'grouped'=>{
    'UserId'=>{
      'matches'=>22154,
      'groups'=>[]},
    'Field1:[* TO *] AND Field2:[* TO *]'=>{
      'matches'=>22154,
      'doclist'=>{'numFound'=>1282,'start'=>0,'docs'=>[
          {
            'UserId'=>255},
          {
            'UserId'=>3042},
          {
            'UserId'=>3428},
          {
            'UserId'=>255},
          {
            'UserId'=>3042},
          {
            'UserId'=>3042},
          {
            'UserId'=>68},
          {
            'UserId'=>68},
          {
            'UserId'=>68},
          {
            'UserId'=>68}]
 }}}


Desired output:

'grouped'=>{
    'UserId'=>{
      'matches'=>22154,
      'groups'=>[]},
    'Field1:[* TO *] AND Field2:[* TO *]'=>{
      'matches'=>22154,
      'doclist'=>{'numFound'=>1282,'start'=>0,'docs'=>[
          {
            '255'=>2},
          {
            '3042'=>3},
          {
            '3428'=>1},
          {
            '68'=>4}]
 }}}



-- 
Dmitry Kan
Luke Toolbox: http://github.com/DmitryKey/luke
Blog: http://dmitrykan.blogspot.com
Twitter: http://twitter.com/dmitrykan
SemanticAnalyzer: www.semanticanalyzer.info

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message