Examples of norms()


Examples of org.apache.lucene.index.IndexReader.norms()

    for (Object field : aprioriReader.getFieldNames(IndexReader.FieldOption.ALL)) {

      // test norms as used by normal use

      byte[] aprioriNorms = aprioriReader.norms((String) field);
      byte[] testNorms = testReader.norms((String) field);

      if (aprioriNorms != null) {
        assertEquals(aprioriNorms.length, testNorms.length);

        for (int i = 0; i < aprioriNorms.length; i++) {
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

        aprioriNorms = new byte[aprioriReader.maxDoc()];
        aprioriReader.norms((String) field, aprioriNorms, 0);

        testNorms = new byte[testReader.maxDoc()];
        testReader.norms((String) field, testNorms, 0);

        assertEquals(aprioriNorms.length, testNorms.length);

        for (int i = 0; i < aprioriNorms.length; i++) {
          assertEquals("norms does not equals for field " + field + " in document " + i, aprioriNorms[i], testNorms[i]);
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

        aprioriNorms = new byte[aprioriReader.maxDoc() + 10];
        aprioriReader.norms((String) field, aprioriNorms, 10);

        testNorms = new byte[testReader.maxDoc() + 10];
        testReader.norms((String) field, testNorms, 10);

        assertEquals(aprioriNorms.length, testNorms.length);
       
        for (int i = 0; i < aprioriNorms.length; i++) {
          assertEquals("norms does not equals for field " + field + " in document " + i, aprioriNorms[i], testNorms[i]);
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

    }
 
    public void testFieldWithNoNorm() throws Exception {

  IndexReader r = IndexReader.open(store);
  byte[] norms = r.norms("nonorm");

  // sanity check, norms should all be 1
  assertTrue("Whoops we have norms?", !r.hasNorms("nonorm"));
  for (int i = 0; i< norms.length; i++) {
      assertEquals(""+i, DEFAULT_NORM, norms[i]);
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

  }

  // nothing should have changed
  r = IndexReader.open(store);
 
  norms = r.norms("nonorm");
  assertTrue("Whoops we have norms?", !r.hasNorms("nonorm"));
  for (int i = 0; i< norms.length; i++) {
      assertEquals(""+i, DEFAULT_NORM, norms[i]);
  }
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

  }
 
  public void testFieldWithNoNorm() throws Exception {
   
    IndexReader r = IndexReader.open(store);
    byte[] norms = r.norms("nonorm");
   
    // sanity check, norms should all be 1
    assertTrue("Whoops we have norms?", !r.hasNorms("nonorm"));
    for (int i = 0; i< norms.length; i++) {
      assertEquals(""+i, DEFAULT_NORM, norms[i]);
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

    }
   
    // nothing should have changed
    r = IndexReader.open(store);
   
    norms = r.norms("nonorm");
    assertTrue("Whoops we have norms?", !r.hasNorms("nonorm"));
    for (int i = 0; i< norms.length; i++) {
      assertEquals(""+i, DEFAULT_NORM, norms[i]);
    }
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

  }

  public void testNormKiller() throws IOException {

    IndexReader r = IndexReader.open(store);
    byte[] oldNorms = r.norms("untokfield");   
    r.close();
   
    FieldNormModifier fnm = new FieldNormModifier(store, s);
    fnm.reSetNorms("untokfield");
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

   
    FieldNormModifier fnm = new FieldNormModifier(store, s);
    fnm.reSetNorms("untokfield");

    r = IndexReader.open(store);
    byte[] newNorms = r.norms("untokfield");
    r.close();
    assertFalse(Arrays.equals(oldNorms, newNorms));   

   
    // verify that we still get documents in the same order as originally
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.norms()

    }
 
    public void testFieldWithNoNorm() throws Exception {

  IndexReader r = IndexReader.open(store);
  byte[] norms = r.norms("nonorm");

  // sanity check, norms should all be 1
  assertTrue("Whoops we have norms?", !r.hasNorms("nonorm"));
  for (int i = 0; i< norms.length; i++) {
      assertEquals(""+i, DEFAULT_NORM, norms[i]);
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.