コード例 #1
0
 @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;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 public FunctionWeight(Searcher searcher) throws IOException {
   this.searcher = searcher;
   this.context = ValueSource.newContext();
   func.createWeight(context, searcher);
 }
コード例 #4
0
 /** Returns a hash code value for this object. */
 @Override
 public int hashCode() {
   return func.hashCode() * 31 + Float.floatToIntBits(getBoost());
 }
コード例 #5
0
 /** 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);
 }