Examples of computeNorm()


Examples of org.apache.lucene.search.DefaultSimilarity.computeNorm()

    final FieldInvertState invertState = new FieldInvertState();
    invertState.setBoost(1.0f);
    for (int i = 1; i < 1000; i++) {
      invertState.setLength(i);
      assertEquals("base case: i="+i,
                   d.computeNorm("foo", invertState),
                   s.computeNorm("foo", invertState),
                   0.0f);
    }

    // make a sweet spot
View Full Code Here

Examples of org.apache.lucene.search.DefaultSimilarity.computeNorm()

                   0.0f);
    }
 
    for (int i = 10; i < 1000; i++) {
      invertState.setLength(i-9);
      final float normD = d.computeNorm("foo", invertState);
      invertState.setLength(i);
      final float normS = s.computeNorm("foo", invertState);
      assertEquals("3,10: 10<x : i="+i,
                   normD,
                   normS,
View Full Code Here

Examples of org.apache.lucene.search.DefaultSimilarity.computeNorm()

                   s.computeNorm("foo", invertState),
                   0.0f);
    }
    for (int i = 10; i < 1000; i++) {
      invertState.setLength(i-9);
      final float normD = d.computeNorm("foo", invertState);
      invertState.setLength(i);
      final float normS = s.computeNorm("foo", invertState);
      assertEquals("f: 3,10: 10<x : i="+i,
                   normD,
                   normS,
View Full Code Here

Examples of org.apache.lucene.search.DefaultSimilarity.computeNorm()

                   s.computeNorm("yak", invertState),
                   0.0f);
    }
    for (int i = 13; i < 1000; i++) {
      invertState.setLength(i-12);
      final float normD = d.computeNorm("foo", invertState);
      invertState.setLength(i);
      final float normS = s.computeNorm("bar", invertState);
      assertEquals("f: 8,13: 13<x : i="+i,
                   normD,
                   normS,
View Full Code Here

Examples of org.apache.lucene.search.DefaultSimilarity.computeNorm()

                   normS,
                   0.0f);
    }
    for (int i = 9; i < 1000; i++) {
      invertState.setLength(i-8);
      final float normD = d.computeNorm("foo", invertState);
      invertState.setLength(i);
      final float normS = s.computeNorm("yak", invertState);
      assertEquals("f: 6,9: 9<x : i="+i,
                   normD,
                   normS,
View Full Code Here

Examples of org.apache.lucene.search.Similarity.computeNorm()

        Info info = getInfo(fieldName);
        int numTokens = info != null ? info.numTokens : 0;
        int numOverlapTokens = info != null ? info.numOverlapTokens : 0;
        float boost = info != null ? info.getBoost() : 1.0f;
        FieldInvertState invertState = new FieldInvertState(0, numTokens, numOverlapTokens, 0, boost);
        float n = sim.computeNorm(fieldName, invertState);
        byte norm = Similarity.encodeNorm(n);
        norms = new byte[] {norm};
       
        // cache it for future reuse
        cachedNorms = norms;
View Full Code Here

Examples of org.apache.lucene.search.Similarity.computeNorm()

        Info info = getInfo(fieldName);
        int numTokens = info != null ? info.numTokens : 0;
        int numOverlapTokens = info != null ? info.numOverlapTokens : 0;
        float boost = info != null ? info.getBoost() : 1.0f;
        FieldInvertState invertState = new FieldInvertState(0, numTokens, numOverlapTokens, 0, boost);
        float n = sim.computeNorm(fieldName, invertState);
        byte norm = sim.encodeNormValue(n);
        norms = new byte[] {norm};
       
        // cache it for future reuse
        cachedNorms = norms;
View Full Code Here

Examples of org.apache.lucene.search.Similarity.computeNorm()

        Info info = getInfo(fieldName);
        int numTokens = info != null ? info.numTokens : 0;
        int numOverlapTokens = info != null ? info.numOverlapTokens : 0;
        float boost = info != null ? info.getBoost() : 1.0f;
        FieldInvertState invertState = new FieldInvertState(0, numTokens, numOverlapTokens, 0, boost);
        float n = sim.computeNorm(fieldName, invertState);
        byte norm = Similarity.encodeNorm(n);
        norms = new byte[] {norm};
       
        // cache it for future reuse
        cachedNorms = norms;
View Full Code Here

Examples of org.apache.lucene.search.Similarity.computeNorm()

        Info info = getInfo(fieldName);
        int numTokens = info != null ? info.numTokens : 0;
        int numOverlapTokens = info != null ? info.numOverlapTokens : 0;
        float boost = info != null ? info.getBoost() : 1.0f;
        FieldInvertState invertState = new FieldInvertState(0, numTokens, numOverlapTokens, 0, boost);
        float n = sim.computeNorm(fieldName, invertState);
        byte norm = sim.encodeNormValue(n);
        norms = new byte[] {norm};
       
        // cache it for future reuse
        cachedNorms = norms;
View Full Code Here

Examples of org.apache.lucene.search.Similarity.computeNorm()

        Info info = getInfo(fieldName);
        int numTokens = info != null ? info.numTokens : 0;
        int numOverlapTokens = info != null ? info.numOverlapTokens : 0;
        float boost = info != null ? info.getBoost() : 1.0f;
        FieldInvertState invertState = new FieldInvertState(0, numTokens, numOverlapTokens, 0, boost);
        float n = sim.computeNorm(fieldName, invertState);
        byte norm = Similarity.encodeNorm(n);
        norms = new byte[] {norm};
       
        // cache it for future reuse
        cachedNorms = norms;
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.