Java 类org.apache.lucene.search.Scorer.ChildScorer 实例源码

项目:NYBC    文件:ToParentBlockJoinCollector.java   
@Override
public void setScorer(Scorer scorer) {
  //System.out.println("C.setScorer scorer=" + scorer);
  // Since we invoke .score(), and the comparators likely
  // do as well, cache it so it's only "really" computed
  // once:
  this.scorer = new ScoreCachingWrappingScorer(scorer);
  for (int compIDX = 0; compIDX < comparators.length; compIDX++) {
    comparators[compIDX].setScorer(this.scorer);
  }
  Arrays.fill(joinScorers, null);

  Queue<Scorer> queue = new LinkedList<Scorer>();
  queue.add(scorer);
  while ((scorer = queue.poll()) != null) {
    if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) {
      enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer);
    }

    for (ChildScorer sub : scorer.getChildren()) {
      queue.add(sub.child);
    }
  }
}
项目:search    文件:AssertingSubDocsAtOnceCollector.java   
@Override
public void setScorer(Scorer s) {
  // Gathers all scorers, including s and "under":
  allScorers = new ArrayList<>();
  allScorers.add(s);
  int upto = 0;
  while(upto < allScorers.size()) {
    s = allScorers.get(upto++);
    for (ChildScorer sub : s.getChildren()) {
      allScorers.add(sub.child);
    }
  }
}
项目:search    文件:ToParentBlockJoinCollector.java   
@Override
public void setScorer(Scorer scorer) {
  //System.out.println("C.setScorer scorer=" + scorer);
  // Since we invoke .score(), and the comparators likely
  // do as well, cache it so it's only "really" computed
  // once:
  this.scorer = new ScoreCachingWrappingScorer(scorer);
  for (int compIDX = 0; compIDX < comparators.length; compIDX++) {
    comparators[compIDX].setScorer(this.scorer);
  }
  Arrays.fill(joinScorers, null);

  Queue<Scorer> queue = new LinkedList<>();
  //System.out.println("\nqueue: add top scorer=" + scorer);
  queue.add(scorer);
  while ((scorer = queue.poll()) != null) {
    //System.out.println("  poll: " + scorer + "; " + scorer.getWeight().getQuery());
    if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) {
      enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer);
    }

    for (ChildScorer sub : scorer.getChildren()) {
      //System.out.println("  add sub: " + sub.child + "; " + sub.child.getWeight().getQuery());
      queue.add(sub.child);
    }
  }
}
项目:search    文件:TestBooleanQueryVisitSubscorers.java   
private void fillLeaves(Scorer scorer, Set<Scorer> set) {
  if (scorer.getWeight().getQuery() instanceof TermQuery) {
    set.add(scorer);
  } else {
    for (ChildScorer child : scorer.getChildren()) {
      fillLeaves(child.child, set);
    }
  }
}
项目:search    文件:TestBooleanQueryVisitSubscorers.java   
private static void summarizeScorer(final StringBuilder builder, final Scorer scorer, final int indent) {
  builder.append(scorer.getClass().getSimpleName());
  if (scorer instanceof TermScorer) {
    TermQuery termQuery = (TermQuery) scorer.getWeight().getQuery();
    builder.append(" ").append(termQuery.getTerm().field()).append(":").append(termQuery.getTerm().text());
  }
  for (final ChildScorer childScorer : scorer.getChildren()) {
    indent(builder, indent + 1).append(childScorer.relationship).append(" ");
    summarizeScorer(builder, childScorer.child, indent + 2);
  }
}
项目:search    文件:TestSubScorerFreqs.java   
public void setSubScorers(Scorer scorer, String relationship) {
  for (ChildScorer child : scorer.getChildren()) {
    if (scorer instanceof AssertingScorer || relationships.contains(child.relationship)) {
      setSubScorers(child.child, child.relationship);
    }
  }
  subScorers.put(scorer.getWeight().getQuery(), scorer);
}
项目:NYBC    文件:TestBooleanQueryVisitSubscorers.java   
private void fillLeaves(Scorer scorer, Set<Scorer> set) {
  if (scorer.getWeight().getQuery() instanceof TermQuery) {
    set.add(scorer);
  } else {
    for (ChildScorer child : scorer.getChildren()) {
      fillLeaves(child.child, set);
    }
  }
}
项目:NYBC    文件:TestSubScorerFreqs.java   
public void setSubScorers(Scorer scorer, String relationship) {
  for (ChildScorer child : scorer.getChildren()) {
    if (relationships.contains(child.relationship)) {
      setSubScorers(child.child, child.relationship);
    }
  }
  subScorers.put(scorer.getWeight().getQuery(), scorer);
}
项目:read-open-source-code    文件:ToParentBlockJoinCollector.java   
@Override
public void setScorer(Scorer scorer) {
  //System.out.println("C.setScorer scorer=" + scorer);
  // Since we invoke .score(), and the comparators likely
  // do as well, cache it so it's only "really" computed
  // once:
  this.scorer = new ScoreCachingWrappingScorer(scorer);
  for (int compIDX = 0; compIDX < comparators.length; compIDX++) {
    comparators[compIDX].setScorer(this.scorer);
  }
  Arrays.fill(joinScorers, null);

  Queue<Scorer> queue = new LinkedList<Scorer>();
  //System.out.println("\nqueue: add top scorer=" + scorer);
  queue.add(scorer);
  while ((scorer = queue.poll()) != null) {
    //System.out.println("  poll: " + scorer + "; " + scorer.getWeight().getQuery());
    if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) {
      enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer);
    }

    for (ChildScorer sub : scorer.getChildren()) {
      //System.out.println("  add sub: " + sub.child + "; " + sub.child.getWeight().getQuery());
      queue.add(sub.child);
    }
  }
}
项目:read-open-source-code    文件:ToParentBlockJoinCollector.java   
@Override
public void setScorer(Scorer scorer) {
  //System.out.println("C.setScorer scorer=" + scorer);
  // Since we invoke .score(), and the comparators likely
  // do as well, cache it so it's only "really" computed
  // once:
  this.scorer = new ScoreCachingWrappingScorer(scorer);
  for (int compIDX = 0; compIDX < comparators.length; compIDX++) {
    comparators[compIDX].setScorer(this.scorer);
  }
  Arrays.fill(joinScorers, null);

  Queue<Scorer> queue = new LinkedList<Scorer>();
  //System.out.println("\nqueue: add top scorer=" + scorer);
  queue.add(scorer);
  while ((scorer = queue.poll()) != null) {
    //System.out.println("  poll: " + scorer + "; " + scorer.getWeight().getQuery());
    if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) {
      enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer);
    }

    for (ChildScorer sub : scorer.getChildren()) {
      //System.out.println("  add sub: " + sub.child + "; " + sub.child.getWeight().getQuery());
      queue.add(sub.child);
    }
  }
}
项目:read-open-source-code    文件:ToParentBlockJoinCollector.java   
@Override
public void setScorer(Scorer scorer) {
  //System.out.println("C.setScorer scorer=" + scorer);
  // Since we invoke .score(), and the comparators likely
  // do as well, cache it so it's only "really" computed
  // once:
  this.scorer = new ScoreCachingWrappingScorer(scorer);
  for (int compIDX = 0; compIDX < comparators.length; compIDX++) {
    comparators[compIDX].setScorer(this.scorer);
  }
  Arrays.fill(joinScorers, null);

  Queue<Scorer> queue = new LinkedList<>();
  //System.out.println("\nqueue: add top scorer=" + scorer);
  queue.add(scorer);
  while ((scorer = queue.poll()) != null) {
    //System.out.println("  poll: " + scorer + "; " + scorer.getWeight().getQuery());
    if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) {
      enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer);
    }

    for (ChildScorer sub : scorer.getChildren()) {
      //System.out.println("  add sub: " + sub.child + "; " + sub.child.getWeight().getQuery());
      queue.add(sub.child);
    }
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:DrillSidewaysCollector.java   
private void findScorers(Scorer scorer) {
  Integer index = weightToIndex.get(scorer.getWeight());
  if (index != null) {
    if (index.intValue() == -1) {
      mainScorer = scorer;
    } else {
      subScorers[index] = scorer;
    }
  }
  for(ChildScorer child : scorer.getChildren()) {
    findScorers(child.child);
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:AssertingSubDocsAtOnceCollector.java   
@Override
public void setScorer(Scorer s) {
  // Gathers all scorers, including s and "under":
  allScorers = new ArrayList<Scorer>();
  allScorers.add(s);
  int upto = 0;
  while(upto < allScorers.size()) {
    s = allScorers.get(upto++);
    for (ChildScorer sub : s.getChildren()) {
      allScorers.add(sub.child);
    }
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:ToParentBlockJoinCollector.java   
@Override
public void setScorer(Scorer scorer) {
  //System.out.println("C.setScorer scorer=" + scorer);
  // Since we invoke .score(), and the comparators likely
  // do as well, cache it so it's only "really" computed
  // once:
  this.scorer = new ScoreCachingWrappingScorer(scorer);
  for (int compIDX = 0; compIDX < comparators.length; compIDX++) {
    comparators[compIDX].setScorer(this.scorer);
  }
  Arrays.fill(joinScorers, null);

  Queue<Scorer> queue = new LinkedList<Scorer>();
  //System.out.println("\nqueue: add top scorer=" + scorer);
  queue.add(scorer);
  while ((scorer = queue.poll()) != null) {
    //System.out.println("  poll: " + scorer + "; " + scorer.getWeight().getQuery());
    if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) {
      enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer);
    }

    for (ChildScorer sub : scorer.getChildren()) {
      //System.out.println("  add sub: " + sub.child + "; " + sub.child.getWeight().getQuery());
      queue.add(sub.child);
    }
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:TestBooleanQueryVisitSubscorers.java   
private void fillLeaves(Scorer scorer, Set<Scorer> set) {
  if (scorer.getWeight().getQuery() instanceof TermQuery) {
    set.add(scorer);
  } else {
    for (ChildScorer child : scorer.getChildren()) {
      fillLeaves(child.child, set);
    }
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:TestSubScorerFreqs.java   
public void setSubScorers(Scorer scorer, String relationship) {
  for (ChildScorer child : scorer.getChildren()) {
    if (relationships.contains(child.relationship)) {
      setSubScorers(child.child, child.relationship);
    }
  }
  subScorers.put(scorer.getWeight().getQuery(), scorer);
}
项目:lams    文件:BooleanTopLevelScorers.java   
@Override
public Collection<ChildScorer> getChildren() {
  return Collections.singleton(new ChildScorer(in, "BOOSTED"));
}
项目:search    文件:BooleanTopLevelScorers.java   
@Override
public Collection<ChildScorer> getChildren() {
  return Collections.singleton(new ChildScorer(in, "BOOSTED"));
}
项目:NYBC    文件:ToChildBlockJoinQuery.java   
@Override
public Collection<ChildScorer> getChildren() {
  return Collections.singleton(new ChildScorer(parentScorer, "BLOCK_JOIN"));
}
项目:read-open-source-code    文件:BooleanTopLevelScorers.java   
@Override
public Collection<ChildScorer> getChildren() {
  return Collections.singleton(new ChildScorer(in, "BOOSTED"));
}
项目:Maskana-Gestor-de-Conocimiento    文件:ToChildBlockJoinQuery.java   
@Override
public Collection<ChildScorer> getChildren() {
  return Collections.singleton(new ChildScorer(parentScorer, "BLOCK_JOIN"));
}