Examples of bytesRef()


Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

    SegmentReader reader1 = SegmentReader.getOnlySegmentReader(dir1);
    reader1.norms("field1");
    Norm r1norm = reader1.norms.get("field1");
    AtomicInteger r1BytesRef = r1norm.bytesRef();
    SegmentReader reader2 = (SegmentReader)reader1.clone();
    assertEquals(2, r1norm.bytesRef().get());
    reader1.close();
    assertEquals(1, r1BytesRef.get());
    reader2.norms("field1");
    reader2.close();
    dir1.close();
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

       
    IndexReader reader2C = (IndexReader) reader1.clone();
    SegmentReader segmentReader2C = SegmentReader.getOnlySegmentReader(reader2C);
    segmentReader2C.norms("field1"); // load the norms for the field
    Norm reader2CNorm = segmentReader2C.norms.get("field1");
    assertTrue("reader2CNorm.bytesRef()=" + reader2CNorm.bytesRef(), reader2CNorm.bytesRef().get() == 2);
   
   
   
    IndexReader reader3C = (IndexReader) reader2C.clone();
    SegmentReader segmentReader3C = SegmentReader.getOnlySegmentReader(reader3C);
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

       
    IndexReader reader2C = (IndexReader) reader1.clone();
    SegmentReader segmentReader2C = SegmentReader.getOnlySegmentReader(reader2C);
    segmentReader2C.norms("field1"); // load the norms for the field
    Norm reader2CNorm = segmentReader2C.norms.get("field1");
    assertTrue("reader2CNorm.bytesRef()=" + reader2CNorm.bytesRef(), reader2CNorm.bytesRef().get() == 2);
   
   
   
    IndexReader reader3C = (IndexReader) reader2C.clone();
    SegmentReader segmentReader3C = SegmentReader.getOnlySegmentReader(reader3C);
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

   
   
    IndexReader reader3C = (IndexReader) reader2C.clone();
    SegmentReader segmentReader3C = SegmentReader.getOnlySegmentReader(reader3C);
    Norm reader3CCNorm = segmentReader3C.norms.get("field1");
    assertEquals(3, reader3CCNorm.bytesRef().get());
   
    // edit a norm and the refcount should be 1
    IndexReader reader4C = (IndexReader) reader3C.clone();
    SegmentReader segmentReader4C = SegmentReader.getOnlySegmentReader(reader4C);
    assertEquals(4, reader3CCNorm.bytesRef().get());
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

    assertEquals(3, reader3CCNorm.bytesRef().get());
   
    // edit a norm and the refcount should be 1
    IndexReader reader4C = (IndexReader) reader3C.clone();
    SegmentReader segmentReader4C = SegmentReader.getOnlySegmentReader(reader4C);
    assertEquals(4, reader3CCNorm.bytesRef().get());
    reader4C.setNorm(5, "field1", 0.33f);
   
    // generate a cannot update exception in reader1
    try {
      reader3C.setNorm(1, "field1", 0.99f);
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

    // norm values should be different
    assertTrue(Similarity.getDefault().decodeNormValue(segmentReader3C.norms("field1")[5])
        != Similarity.getDefault().decodeNormValue(segmentReader4C.norms("field1")[5]));
    Norm reader4CCNorm = segmentReader4C.norms.get("field1");
    assertEquals(3, reader3CCNorm.bytesRef().get());
    assertEquals(1, reader4CCNorm.bytesRef().get());
       
    IndexReader reader5C = (IndexReader) reader4C.clone();
    SegmentReader segmentReader5C = SegmentReader.getOnlySegmentReader(reader5C);
    Norm reader5CCNorm = segmentReader5C.norms.get("field1");
    reader5C.setNorm(5, "field1", 0.7f);
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

       
    IndexReader reader5C = (IndexReader) reader4C.clone();
    SegmentReader segmentReader5C = SegmentReader.getOnlySegmentReader(reader5C);
    Norm reader5CCNorm = segmentReader5C.norms.get("field1");
    reader5C.setNorm(5, "field1", 0.7f);
    assertEquals(1, reader5CCNorm.bytesRef().get());

    reader5C.close();
    reader4C.close();
    reader3C.close();
    reader2C.close();
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

    assertDelDocsRefCountEquals(2, origSegmentReader);
    origSegmentReader.close();
    assertDelDocsRefCountEquals(1, origSegmentReader);
    // check the norm refs
    Norm norm = (Norm) clonedSegmentReader.norms.get("field1");
    assertEquals(1, norm.bytesRef().refCount());
    clonedSegmentReader.close();
    dir1.close();
  }
 
  public void testSegmentReaderDelDocsReferenceCounting() throws Exception {
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

    Directory dir1 = new MockRAMDirectory();
    TestIndexReaderReopen.createIndex(dir1, false);
    SegmentReader reader1 = SegmentReader.getOnlySegmentReader(dir1);
    reader1.norms("field1");
    Norm r1norm = (Norm)reader1.norms.get("field1");
    SegmentReader.Ref r1BytesRef = r1norm.bytesRef();
    SegmentReader reader2 = (SegmentReader)reader1.clone();
    assertEquals(2, r1norm.bytesRef().refCount());
    reader1.close();
    assertEquals(1, r1BytesRef.refCount());
    reader2.norms("field1");
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.Norm.bytesRef()

    SegmentReader reader1 = SegmentReader.getOnlySegmentReader(dir1);
    reader1.norms("field1");
    Norm r1norm = (Norm)reader1.norms.get("field1");
    SegmentReader.Ref r1BytesRef = r1norm.bytesRef();
    SegmentReader reader2 = (SegmentReader)reader1.clone();
    assertEquals(2, r1norm.bytesRef().refCount());
    reader1.close();
    assertEquals(1, r1BytesRef.refCount());
    reader2.norms("field1");
    reader2.close();
    dir1.close();
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.