Package org.apache.lucene.index

Examples of org.apache.lucene.index.TermPositions.doc()


          if(tp.freq() > 0)
          {
            tp.nextPosition();
            tp.getPayload(payloadBuffer, 0);
            int len = bytesToInt(payloadBuffer);
            allocate(tp.doc(), Math.min(len, _maxItems), true);
          }
        }
      }
      finally
      {
View Full Code Here


    // create term-document informations
    for (InstantiatedTerm term : orderedTerms) {
      TermPositions termPositions = sourceIndexReader.termPositions(term.getTerm());
      int position = 0;
      while (termPositions.next()) {
        InstantiatedDocument document = documentsByNumber[termPositions.doc()];

        byte[][] payloads = new byte[termPositions.freq()][];
        int[] positions = new int[termPositions.freq()];
        for (int i = 0; i < termPositions.freq(); i++) {
          positions[i] = termPositions.nextPosition();
View Full Code Here

    // create term-document informations
    for (InstantiatedTerm term : orderedTerms) {
      TermPositions termPositions = sourceIndexReader.termPositions(term.getTerm());
      int position = 0;
      while (termPositions.next()) {
        InstantiatedDocument document = documentsByNumber[termPositions.doc()];

        byte[][] payloads = new byte[termPositions.freq()][];
        int[] positions = new int[termPositions.freq()];
        for (int i = 0; i < termPositions.freq(); i++) {
          positions[i] = termPositions.nextPosition();
View Full Code Here

    {
          tp = reader.termPositions(UID_TERM);
          int idx = 0;
          while (tp.next())
          {
            int doc = tp.doc();
            assert doc < maxDoc;
           
            while(idx < doc) _uidArray[idx++] = DELETED_UID; // fill the gap
           
            tp.nextPosition();
View Full Code Here

                return null; // no doc
            }
            // Note, only master docs uid have version payload, so we can use that info to not
            // take them into account
            do {
                docId = uid.doc();
                uid.nextPosition();
                if (!uid.isPayloadAvailable()) {
                    continue;
                }
                if (uid.getPayloadLength() < 8) {
View Full Code Here

        throw new CorruptIndexException("Missing parent data for category " + first);
      }
      for (int i=first; i<num; i++) {
        // Note that we know positions.doc() >= i (this is an
        // invariant kept throughout this loop)
        if (positions.doc()==i) {
          if (positions.freq() == 0) { // shouldn't happen
            throw new CorruptIndexException(
                "Missing parent data for category "+i);
          }
View Full Code Here

        tp.nextPosition();
        if(tp.isPayloadAvailable())
        {
          int len = tp.getPayloadLength();
          payloadBuf = tp.getPayload(payloadBuf, 0);
          add(tp.doc(), payloadBuf, len);
        }
      }
    }
   
    // save the last page
View Full Code Here

          if(tp.freq() > 0)
          {
            tp.nextPosition();
            tp.getPayload(payloadBuffer, 0);
            int len = bytesToInt(payloadBuffer);
            allocate(tp.doc(), Math.min(len, _maxItems), true);
          }
        }
      }
      finally
      {
View Full Code Here

          if(tp.freq() > 0)
          {
            tp.nextPosition();
            tp.getPayload(payloadBuffer, 0);
            int len = bytesToInt(payloadBuffer);
            allocate(tp.doc(), Math.min(len, _maxItems), true);
          }
        }
      }
      finally
      {
View Full Code Here

          private ScoredMatch match = new ScoredMatch(0, new DocId(data, 0, 0));
        @Override
        public ScoredMatch apply(RawMatch rawMatch) {
          int rawId = rawMatch.getRawId();
          try {
            if (payloads.skipTo(rawId) && payloads.doc() == rawId) {
              payloads.nextPosition();
              int size = payloads.getPayloadLength();
              if (size > data.length) {
                  data = new byte[size];
              }
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.