Examples of copyBytes()


Examples of org.apache.lucene.util.BytesRef.copyBytes()

        continue; // for duplicate suggestions, the best weight is actually
                  // added
      }
      Util.toIntsRef(scratch, scratchInts);
      builder.add(scratchInts, cost);
      previous.copyBytes(scratch);
      count++;
    }
    fst = builder.finish();
  }
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

        // prefix-code
        int sharedPrefix = StringHelper.bytesDifference(lastTerm, v);
        data.writeVInt(sharedPrefix);
        data.writeVInt(v.length - sharedPrefix);
        data.writeBytes(v.bytes, v.offset + sharedPrefix, v.length - sharedPrefix);
        lastTerm.copyBytes(v);
        count++;
      }
      final long indexStartFP = data.getFilePointer();
      // write addresses of indexed terms
      termAddresses.finish();
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

        int bytesRefDoc = -1;
        BytesRef bytesRef = new BytesRef();//scratch

        boolean fillBytes(int doc) {
          if (bytesRefDoc != doc) {
            bytesRef.copyBytes(docValues.get(doc));
            bytesRefDoc = doc;
          }
          return bytesRef.length != 0;
        }
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

        // prefix-code
        int sharedPrefix = StringHelper.bytesDifference(lastTerm, v);
        data.writeVInt(sharedPrefix);
        data.writeVInt(v.length - sharedPrefix);
        data.writeBytes(v.bytes, v.offset + sharedPrefix, v.length - sharedPrefix);
        lastTerm.copyBytes(v);
        count++;
      }
      final long indexStartFP = data.getFilePointer();
      // write addresses of indexed terms
      termAddresses.finish();
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

      termAndPostings = new TermAndPostings[numTerms];
      BytesRef lastTerm = new BytesRef();
      for (int i = 0; i < numTerms; i++) {
        TermAndPostings t = new TermAndPostings();
        BytesRef term = new BytesRef();
        term.copyBytes(lastTerm);
        final int start = tvf.readVInt();
        final int deltaLen = tvf.readVInt();
        term.length = start + deltaLen;
        term.grow(term.length);
        tvf.readBytes(term.bytes, start, deltaLen);
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

       
        private void setTerm() {
          // TODO: is there a cleaner way
          term.bytes = new byte[termBuffer.length];
          term.offset = 0;
          term.copyBytes(termBuffer);
        }

        @Override
        public BytesRef term() throws IOException {
          return term;
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

        // prefix-code
        int sharedPrefix = StringHelper.bytesDifference(lastTerm, v);
        data.writeVInt(sharedPrefix);
        data.writeVInt(v.length - sharedPrefix);
        data.writeBytes(v.bytes, v.offset + sharedPrefix, v.length - sharedPrefix);
        lastTerm.copyBytes(v);
        count++;
      }
      final long indexStartFP = data.getFilePointer();
      // write addresses of indexed terms
      termAddresses.finish();
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

        continue; // for duplicate suggestions, the best weight is actually
                  // added
      }
      Util.toIntsRef(scratch, scratchInts);
      builder.add(scratchInts, cost);
      previous.copyBytes(scratch);
    }
    fst = builder.finish();
  }

 
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

    assertEquals(uniqueValues, bd1.terms.keySet());
    assertEquals(uniqueValues, bd2.terms.keySet());
    HashSet<Term> frozenSet = new HashSet<Term>();
    for (Term t : queue.freezeGlobalBuffer(null).termsIterable()) {
      BytesRef bytesRef = new BytesRef();
      bytesRef.copyBytes(t.bytes);
      frozenSet.add(new Term(t.field, bytesRef));
    }
    assertEquals(uniqueValues, frozenSet);
    assertEquals("num deletes must be 0 after freeze", 0, queue
        .numGlobalTermDeletes());
View Full Code Here

Examples of org.apache.lucene.util.BytesRef.copyBytes()

    }
    queue.tryApplyGlobalSlice();
    Set<Term> frozenSet = new HashSet<Term>();
    for (Term t : queue.freezeGlobalBuffer(null).termsIterable()) {
      BytesRef bytesRef = new BytesRef();
      bytesRef.copyBytes(t.bytes);
      frozenSet.add(new Term(t.field, bytesRef));
    }
    assertEquals("num deletes must be 0 after freeze", 0, queue
        .numGlobalTermDeletes());
    assertEquals(uniqueValues.size(), frozenSet.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.