Examples of BinaryDocValues


Examples of org.apache.lucene.index.BinaryDocValues

    assertEquals(0, floats.get(0), 0.0f);
   
    Doubles doubles = cache.getDoubles(ar, "bogusdoubles", true);
    assertEquals(0, doubles.get(0), 0.0D);
   
    BinaryDocValues binaries = cache.getTerms(ar, "bogusterms", true);
    BytesRef scratch = binaries.get(0);
    assertEquals(0, scratch.length);
   
    SortedDocValues sorted = cache.getTermsIndex(ar, "bogustermsindex");
    assertEquals(-1, sorted.getOrd(0));
    scratch = sorted.get(0);
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

    assertEquals(0, floats.get(0), 0.0f);
   
    Doubles doubles = cache.getDoubles(ar, "bogusdoubles", true);
    assertEquals(0, doubles.get(0), 0.0D);
   
    BinaryDocValues binaries = cache.getTerms(ar, "bogusterms", true);
    BytesRef scratch = binaries.get(0);
    assertEquals(0, scratch.length);
   
    SortedDocValues sorted = cache.getTermsIndex(ar, "bogustermsindex");
    assertEquals(-1, sorted.getOrd(0));
    scratch = sorted.get(0);
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

      Document hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
      assertEquals(text, hitDoc.get("fieldname"));
      assert ireader.leaves().size() == 1;
      NumericDocValues dv = ireader.leaves().get(0).reader().getNumericDocValues("dv1");
      assertEquals(5, dv.get(hits.scoreDocs[i].doc));
      BinaryDocValues dv2 = ireader.leaves().get(0).reader().getBinaryDocValues("dv2");
      final BytesRef term = dv2.get(hits.scoreDocs[i].doc);
      assertEquals(new BytesRef("hello world"), term);
    }

    ireader.close();
    directory.close();
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

      this.docToOffset = docToOffset;
    }
   
    public BinaryDocValues iterator() {
      final BytesRef term = new BytesRef();
      return new BinaryDocValues() {
        @Override
        public BytesRef get(int docID) {
          final int pointer = (int) docToOffset.get(docID);
          if (pointer == 0) {
            term.length = 0;
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

    };
  }

  @Override
  public synchronized BinaryDocValues getBinary(FieldInfo field) throws IOException {
    BinaryDocValues instance = binaryInstances.get(field.number);
    if (instance == null) {
      switch(LegacyDocValuesType.valueOf(field.getAttribute(legacyKey))) {
        case BYTES_FIXED_STRAIGHT:
          instance = loadBytesFixedStraight(field);
          break;
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

      bytes.copy(input, fixedLength * (long)state.segmentInfo.getDocCount());
      final PagedBytes.Reader bytesReader = bytes.freeze(true);
      CodecUtil.checkEOF(input);
      success = true;
      ramBytesUsed.addAndGet(bytesReader.ramBytesUsed());
      return new BinaryDocValues() {

        @Override
        public BytesRef get(int docID) {
          final BytesRef term = new BytesRef();
          bytesReader.fillSlice(term, fixedLength * (long)docID, fixedLength);
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

      final PackedInts.Reader reader = PackedInts.getReader(index);
      CodecUtil.checkEOF(data);
      CodecUtil.checkEOF(index);
      success = true;
      ramBytesUsed.addAndGet(bytesReader.ramBytesUsed() + reader.ramBytesUsed());
      return new BinaryDocValues() {
        @Override
        public BytesRef get(int docID) {
          final BytesRef term = new BytesRef();
          long startAddress = reader.get(docID);
          long endAddress = reader.get(docID+1);
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

      final PackedInts.Reader reader = PackedInts.getReader(index);
      CodecUtil.checkEOF(data);
      CodecUtil.checkEOF(index);
      ramBytesUsed.addAndGet(bytesReader.ramBytesUsed() + reader.ramBytesUsed());
      success = true;
      return new BinaryDocValues() {
        @Override
        public BytesRef get(int docID) {
          final BytesRef term = new BytesRef();
          final long offset = fixedLength * reader.get(docID);
          bytesReader.fillSlice(term, offset, fixedLength);
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

      final PackedInts.Reader reader = PackedInts.getReader(index);
      CodecUtil.checkEOF(data);
      CodecUtil.checkEOF(index);
      ramBytesUsed.addAndGet(bytesReader.ramBytesUsed() + reader.ramBytesUsed());
      success = true;
      return new BinaryDocValues() {
       
        @Override
        public BytesRef get(int docID) {
          final BytesRef term = new BytesRef();
          long startAddress = reader.get(docID);
View Full Code Here

Examples of org.apache.lucene.index.BinaryDocValues

    // test bad field
    termsIndex = cache.getTermsIndex(reader, "bogusfield");

    // getTerms
    BinaryDocValues terms = cache.getTerms(reader, "theRandomUnicodeString", true);
    Bits bits = cache.getDocsWithField(reader, "theRandomUnicodeString");
    for (int i = 0; i < NUM_DOCS; i++) {
      BytesRef br = terms.get(i);
      final BytesRef term;
      if (!bits.get(i)) {
        term = null;
      } else {
        term = br;
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.