Exemple #1
0
  @Override
  public FTNode item(final QueryContext qc, final InputInfo ii) throws QueryException {
    if (pos == 0) pos = ++qc.ftPos;
    matches.reset(pos);

    final int c = contains(qc);
    if (c == 0) matches.size(0);

    // scoring: include number of tokens for calculations
    return new FTNode(matches, c == 0 ? 0 : Scoring.word(c, qc.ftToken.count()));
  }
Exemple #2
0
 /**
  * Adds a match.
  *
  * @param s start position
  * @param e end position
  */
 void add(final int s, final int e) {
   if (!first && (mode == FTMode.ALL || mode == FTMode.ALL_WORDS)) matches.and(s, e);
   else matches.or(s, e);
 }