Java 类org.apache.lucene.search.spans.NearSpansOrdered 实例源码

项目:lams    文件:PayloadNearQuery.java   
public void getPayloads(Spans[] subSpans) throws IOException {
  for (int i = 0; i < subSpans.length; i++) {
    if (subSpans[i] instanceof NearSpansOrdered) {
      if (((NearSpansOrdered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansOrdered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansOrdered) subSpans[i]).getSubSpans());
    } else if (subSpans[i] instanceof NearSpansUnordered) {
      if (((NearSpansUnordered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansUnordered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansUnordered) subSpans[i]).getSubSpans());
    }
  }
}
项目:search    文件:PayloadNearQuery.java   
public void getPayloads(Spans[] subSpans) throws IOException {
  for (int i = 0; i < subSpans.length; i++) {
    if (subSpans[i] instanceof NearSpansOrdered) {
      if (((NearSpansOrdered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansOrdered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansOrdered) subSpans[i]).getSubSpans());
    } else if (subSpans[i] instanceof NearSpansUnordered) {
      if (((NearSpansUnordered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansUnordered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansUnordered) subSpans[i]).getSubSpans());
    }
  }
}
项目:pyramid    文件:PhraseCountQuery.java   
@Override
public Spans getSpans(final LeafReaderContext context, Postings requiredPostings) throws IOException {

    Terms terms = context.reader().terms(field);
    if (terms == null) {
        return null; // field does not exist
    }

    ArrayList<Spans> subSpans = new ArrayList<>(clauses.size());
    for (CustomSpanWeight w : subWeights) {
        Spans subSpan = w.getSpans(context, requiredPostings);
        if (subSpan != null) {
            subSpans.add(subSpan);
        } else {
            return null; // all required
        }
    }

    // all NearSpans require at least two subSpans
    return (!inOrder) ? new CustomNearSpansUnordered(slop, subSpans)
            : new NearSpansOrdered(slop, subSpans);
}
项目:NYBC    文件:PayloadNearQuery.java   
public void getPayloads(Spans[] subSpans) throws IOException {
  for (int i = 0; i < subSpans.length; i++) {
    if (subSpans[i] instanceof NearSpansOrdered) {
      if (((NearSpansOrdered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansOrdered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansOrdered) subSpans[i]).getSubSpans());
    } else if (subSpans[i] instanceof NearSpansUnordered) {
      if (((NearSpansUnordered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansUnordered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansUnordered) subSpans[i]).getSubSpans());
    }
  }
}
项目:read-open-source-code    文件:PayloadNearQuery.java   
public void getPayloads(Spans[] subSpans) throws IOException {
  for (int i = 0; i < subSpans.length; i++) {
    if (subSpans[i] instanceof NearSpansOrdered) {
      if (((NearSpansOrdered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansOrdered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansOrdered) subSpans[i]).getSubSpans());
    } else if (subSpans[i] instanceof NearSpansUnordered) {
      if (((NearSpansUnordered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansUnordered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansUnordered) subSpans[i]).getSubSpans());
    }
  }
}
项目:read-open-source-code    文件:PayloadNearQuery.java   
public void getPayloads(Spans[] subSpans) throws IOException {
  for (int i = 0; i < subSpans.length; i++) {
    if (subSpans[i] instanceof NearSpansOrdered) {
      if (((NearSpansOrdered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansOrdered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansOrdered) subSpans[i]).getSubSpans());
    } else if (subSpans[i] instanceof NearSpansUnordered) {
      if (((NearSpansUnordered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansUnordered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansUnordered) subSpans[i]).getSubSpans());
    }
  }
}
项目:read-open-source-code    文件:PayloadNearQuery.java   
public void getPayloads(Spans[] subSpans) throws IOException {
  for (int i = 0; i < subSpans.length; i++) {
    if (subSpans[i] instanceof NearSpansOrdered) {
      if (((NearSpansOrdered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansOrdered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansOrdered) subSpans[i]).getSubSpans());
    } else if (subSpans[i] instanceof NearSpansUnordered) {
      if (((NearSpansUnordered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansUnordered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansUnordered) subSpans[i]).getSubSpans());
    }
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:PayloadNearQuery.java   
public void getPayloads(Spans[] subSpans) throws IOException {
  for (int i = 0; i < subSpans.length; i++) {
    if (subSpans[i] instanceof NearSpansOrdered) {
      if (((NearSpansOrdered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansOrdered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansOrdered) subSpans[i]).getSubSpans());
    } else if (subSpans[i] instanceof NearSpansUnordered) {
      if (((NearSpansUnordered) subSpans[i]).isPayloadAvailable()) {
        processPayloads(((NearSpansUnordered) subSpans[i]).getPayload(),
            subSpans[i].start(), subSpans[i].end());
      }
      getPayloads(((NearSpansUnordered) subSpans[i]).getSubSpans());
    }
  }
}