@Override public int hashCode() { int h = q.hashCode(); h ^= (h << 17) | (h >>> 16); h += boostVal.hashCode(); h ^= (h << 8) | (h >>> 25); h += Float.floatToIntBits(getBoost()); return h; }
private CustomScorer( Similarity similarity, Searcher searcher, IndexReader reader, BoostedQuery.BoostedWeight w, Scorer scorer, ValueSource vs) throws IOException { super(similarity, w); this.weight = w; this.qWeight = w.getValue(); this.scorer = scorer; this.reader = reader; this.searcher = searcher; // for explain this.vals = vs.getValues(weight.context, reader); }
public FunctionWeight(Searcher searcher) throws IOException { this.searcher = searcher; this.context = ValueSource.newContext(); func.createWeight(context, searcher); }
/** Returns a hash code value for this object. */ @Override public int hashCode() { return func.hashCode() * 31 + Float.floatToIntBits(getBoost()); }
/** Prints a user-readable version of this query. */ @Override public String toString(String field) { float boost = getBoost(); return (boost != 1.0 ? "(" : "") + func.toString() + (boost == 1.0 ? "" : ")^" + boost); }