159160161162163164165166167168169
//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()); } };
132133134135136137138139
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; }
9899100101102103104105106107
this.thresholds = Collections.emptyMap(); } if (sim != null) { this.sim = sim; } else { sim = new DefaultSimilarity(); } is = new IndexSearcher(in); is.setSimilarity(sim); }