Package org.apache.lucene.search.spans

Examples of org.apache.lucene.search.spans.Spans.start()


      {
        currentInfo = new SpanFilterResult.PositionInfo(doc);
        tmp.add(currentInfo);
        currentDoc = doc;
      }
      currentInfo.addPosition(spans.start(), spans.end());
    }
    return new SpanFilterResult(bits, tmp);
  }

View Full Code Here


      }


      // collect span positions
      while (spans.next()) {
        spanPositions.add(new PositionSpan(spans.start(), spans.end() - 1));
      }
     
    }

    if (spanPositions.size() == 0) {
View Full Code Here

      //intersect w/ doclist
      DocList docList = rb.getResults().docList;
      while (spans.next() == true) {
        //build up the window
        if (docList.exists(spans.doc())) {
          tvm.spanStart = spans.start();
          tvm.spanEnd = spans.end();
          reader.getTermFreqVector(spans.doc(), sQuery.getField(), tvm);
          //The entries map contains the window, do some ranking of it
          if (tvm.passage.terms.isEmpty() == false) {
            log.debug("Candidate: Doc: {} Start: {} End: {} ",
View Full Code Here

          tvm.spanEnd = spans.end();
          reader.getTermFreqVector(spans.doc(), sQuery.getField(), tvm);
          //The entries map contains the window, do some ranking of it
          if (tvm.passage.terms.isEmpty() == false) {
            log.debug("Candidate: Doc: {} Start: {} End: {} ",
                    new Object[]{spans.doc(), spans.start(), spans.end()});
          }
          tvm.passage.lDocId = spans.doc();
          tvm.passage.field = sQuery.getField();
          //score this window
          try {
View Full Code Here

      IndexReader reader = getReaderForField(field);
      Spans spans = spanQuery.getSpans(reader);

      // collect span positions
      while (spans.next()) {
        spanPositions.add(new PositionSpan(spans.start(), spans.end() - 1));
      }
     
    }

    if (spanPositions.size() == 0) {
View Full Code Here

      //System.out.println("\ngetPayloadSpans test");
      Spans pspans = snq.getSpans(is.getIndexReader());
      while (pspans.next()) {
        //System.out.println(pspans.doc() + " - " + pspans.start() + " - "+ pspans.end());
        Collection payloads = pspans.getPayload();
        sawZero |= pspans.start() == 0;
        for (Iterator it = payloads.iterator(); it.hasNext();) {
          count++;
          it.next();
          //System.out.println(new String((byte[]) it.next()));
        }
View Full Code Here

      Spans spans = snq.getSpans(is.getIndexReader());
      count = 0;
      sawZero = false;
      while (spans.next()) {
        count++;
        sawZero |= spans.start() == 0;
        //System.out.println(spans.doc() + " - " + spans.start() + " - " + spans.end());
      }
      assertEquals(4, count);
      assertTrue(sawZero);
   
View Full Code Here

      }


      // collect span positions
      while (spans.next()) {
        spanPositions.add(new PositionSpan(spans.start(), spans.end() - 1));
      }
     
    }

    if (spanPositions.size() == 0) {
View Full Code Here

      Bits acceptDocs = context.reader().getLiveDocs();
      final Spans spans = q.getSpans(context, acceptDocs, termContexts);

      // collect span positions
      while (spans.next()) {
        spanPositions.add(new PositionSpan(spans.start(), spans.end() - 1));
      }
     
    }

    if (spanPositions.size() == 0) {
View Full Code Here

      System.out.println("\ngetPayloadSpans test");
    }
    Spans pspans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
    while (pspans.next()) {
      if (VERBOSE) {
        System.out.println("doc " + pspans.doc() + ": span " + pspans.start()
            + " to " + pspans.end());
      }
      Collection<byte[]> payloads = pspans.getPayload();
      sawZero |= pspans.start() == 0;
      for (byte[] bytes : payloads) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.