Package org.apache.lucene.search

Examples of org.apache.lucene.search.DefaultSimilarity


      //System.out.println(msg);
      lastScore = scores[i];
  }

  // override the norms to be inverted
  Similarity s = new DefaultSimilarity() {
            @Override
            public float computeNorm(String fieldName, FieldInvertState state) {
              return state.getBoost() * (discountOverlaps ? state.getLength() - state.getNumOverlap() : state.getLength());
            }
          };
View Full Code Here


      Map<String,Integer> fieldFlags, int k, float epsilon, int r,
      Similarity sim) {
    super(in, fieldFlags);
    this.k = k;
    is = new IndexSearcher(in);
    is.setSimilarity(sim != null ? sim : new DefaultSimilarity());
    scoreDelta = epsilon * r;
  }
View Full Code Here

      this.thresholds = Collections.emptyMap();
    }
    if (sim != null) {
      this.sim = sim;
    } else {
      sim = new DefaultSimilarity();
    }
    is = new IndexSearcher(in);
    is.setSimilarity(sim);
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.DefaultSimilarity

Copyright © 2018 www.massapicom. 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.