コード例 #1
0
 void collect(int segDoc, int slot) throws IOException {
   if (accs != null) {
     for (SlotAcc acc : accs) {
       acc.collect(segDoc, slot);
     }
   }
 }
コード例 #2
0
 void addStats(SimpleOrderedMap<Object> target, int slotNum) throws IOException {
   int count = countAcc.getCount(slotNum);
   target.add("count", count);
   if (count > 0 || freq.processEmpty) {
     for (SlotAcc acc : accs) {
       acc.setValues(target, slotNum);
     }
   }
 }
コード例 #3
0
  protected void createAccs(int docCount, int slotCount) throws IOException {
    accMap = new LinkedHashMap<>();

    // allow a custom count acc to be used
    if (countAcc == null) {
      countAcc = new CountSlotArrAcc(fcontext, slotCount);
      countAcc.key = "count";
    }

    for (Map.Entry<String, AggValueSource> entry : freq.getFacetStats().entrySet()) {
      SlotAcc acc = entry.getValue().createSlotAcc(fcontext, docCount, slotCount);
      acc.key = entry.getKey();
      accMap.put(acc.key, acc);
    }

    accs = new SlotAcc[accMap.size()];
    int i = 0;
    for (SlotAcc acc : accMap.values()) {
      accs[i++] = acc;
    }
  }
コード例 #4
0
 void setNextReader(LeafReaderContext ctx) throws IOException {
   // countAcc.setNextReader is a no-op
   for (SlotAcc acc : accs) {
     acc.setNextReader(ctx);
   }
 }
コード例 #5
0
 // note: only called by enum/stream prior to collect
 void resetStats() {
   countAcc.reset();
   for (SlotAcc acc : accs) {
     acc.reset();
   }
 }