Package org.apache.solr.request.compare

Examples of org.apache.solr.request.compare.GroupbyRow


     

  private void setCrossRow(RefRow ref,String groupname) throws ParseException, IOException
    {
      this.recordCount.setCrcRecord(groupname);
      GroupbyRow row = new GroupbyRow(new ColumnKey(groupname), ref.val);
      row.setCross(this.parse.crossFs, this.parse.distFS);
      if(this.parse.hasStat())
    {
        for(int i=0;i<this.parse.crossFs.length;i++)
        {
          RefRowStat s=ref.stat[i];
          if(s.issetup)
          {
            row.addStat(i, 1, s.sum);
            row.addStat(i, 2, s.max);
            row.addStat(i, 3, s.min);
            row.addStat(i, 4, (double)s.cnt);
          }else{
            row.addStat(i, 1, 0d);
            row.addStat(i, 2, 0d);
            row.addStat(i, 3, 0d);
            row.addStat(i, 4, 0d);
          }
        }
      }
     
      if(this.parse.hasDist())
      {
        for(int i=0;i<this.parse.distFS.length;i++)
        {
          row.setDistinct(i, ref.dist[i]);
        }
      }
     
      QueuePutUtils.put2Queue(row, this.container.res, this.parse.limit_offset, this.container.cmpString);
    }
View Full Code Here


      p.setCross(this.crossFs, this.distFS);

      if (this.isdetail) {
        countsDetail.add((SelectDetailRow) p.getRaw());
      } else {
        GroupbyRow row=(GroupbyRow) p.getRaw();
        GroupbyRow sfc = counts.get(row.getKey());
        if (sfc == null) {
          row.setDist(autoDist);
          counts.put(row.getKey(), row);
        } else {
          sfc.shardsMerge(row);
        }
      }
   
    }
View Full Code Here


        PriorityQueue<GroupbyRow> res = new PriorityQueue<GroupbyRow>(saverecords, Collections.reverseOrder(cmp));
      for(GroupbyRow f:collections)
      {
        GroupbyRow mrow=f;
        if (res.size() < saverecords) {
          res.add(mrow);
        } else if (cmp.compare(res.peek(), mrow) > 0) {
          res.add(mrow);
          res.poll();
View Full Code Here

    }

    Map<Long, String> crcvalue = (Map<Long, String>) qr2.get_mdrillData();
    ArrayList<Object> newlist = new ArrayList<Object>();
    for (int i = 0; i < fcsize; i++) {
      GroupbyRow row = new GroupbyRow((ArrayList<Object>) facetCounts.get(i));
      row.setKey(new ColumnKey(crcvalue.get(row.getKey().getCrc())));
      newlist.add(row.toNamedList());
    }

    ff.remove("list");
    ff.add("list", newlist);
  }
View Full Code Here

    if (facetCounts != null) {
      fcsize = facetCounts.size();
    }
    String join = "";
    for (int i = 0; i < fcsize; i++) {
      GroupbyRow row = new GroupbyRow((ArrayList<Object>) facetCounts.get(i));
      buff.append(join);
      buff.append(row.getKey().getCrc());
      join = ",";
    }
    return buff.toString();
  }
View Full Code Here

        fcsize = facetCounts.size();
      }
      if(groupValueCacheLast==null)
      {
        for(int i=0;i<fcsize;i++){
          GroupbyRow row = new GroupbyRow((ArrayList<Object>)facetCounts.get(i));
          row.setCross(crossFs, distFS);
          String groupValues = row.getKey().getKey();
             groupValueCache.put(groupValues, row);
             JSONObject jo = new JSONObject();
             setGroup(jo, groupFields, joins, groupValues);
          setStat(jo, showFields, row);
          jsonArray.add(i, jo);
        }
      }else{
        for(int i=0;i<fcsize;i++){
          GroupbyRow row = new GroupbyRow((ArrayList<Object>)facetCounts.get(i));
          row.setCross(crossFs, distFS);
          String groupValues = row.getKey().getKey();
             groupValueCache.put(groupValues, row);
        }
       
        int index=0;
        for(Entry<String,GroupbyRow> e:groupValueCacheLast.entrySet())
        {
             JSONObject jo = new JSONObject();
          String groupValues = e.getKey();
          GroupbyRow row = groupValueCache.get(groupValues);
          if(row==null)
          {
            row=e.getValue();
          }
          row.setCross(crossFs, distFS);

             setGroup(jo, groupFields, joins, groupValues);
          setStat(jo, showFields, row);
          jsonArray.add(index, jo);
          index++;
View Full Code Here

TOP

Related Classes of org.apache.solr.request.compare.GroupbyRow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.