Examples of addDetail()


Examples of org.apache.lucene.search.Explanation.addDetail()

      valSrcScore *= valSrcExpls[i].getValue();
    }
    Explanation exp = new Explanation( valSrcScore * subQueryExpl.getValue(), "custom score: product of:");
    exp.addDetail(subQueryExpl);
    for (int i = 0; i < valSrcExpls.length; i++) {
      exp.addDetail(valSrcExpls[i]);
    }
    return exp;
  }

  /**
 
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

    float valSrcScore = 1;
    if (valSrcExpl != null) {
      valSrcScore *= valSrcExpl.getValue();
    }
    Explanation exp = new Explanation( valSrcScore * subQueryExpl.getValue(), "custom score: product of:");
    exp.addDetail(subQueryExpl);
    exp.addDetail(valSrcExpl);
    return exp;
  }

  //=========================== W E I G H T ============================
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

    if (valSrcExpl != null) {
      valSrcScore *= valSrcExpl.getValue();
    }
    Explanation exp = new Explanation( valSrcScore * subQueryExpl.getValue(), "custom score: product of:");
    exp.addDetail(subQueryExpl);
    exp.addDetail(valSrcExpl);
    return exp;
  }

  //=========================== W E I G H T ============================
 
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

    }
    /* (non-Javadoc)@see org.apache.lucene.search.function.CustomScoreQuery#customExplain(int, org.apache.lucene.search.Explanation, org.apache.lucene.search.Explanation)*/
    public Explanation customExplain(int doc, Explanation subQueryExpl, Explanation valSrcExpl) {
      float valSrcScore = valSrcExpl==null ? 0 : valSrcExpl.getValue();
      Explanation exp = new Explanation( valSrcScore + subQueryExpl.getValue(), "custom score: sum of:");
      exp.addDetail(subQueryExpl);
      if (valSrcExpl != null) {
        exp.addDetail(valSrcExpl);
      }
      return exp;     
    }
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

    public Explanation customExplain(int doc, Explanation subQueryExpl, Explanation valSrcExpl) {
      float valSrcScore = valSrcExpl==null ? 0 : valSrcExpl.getValue();
      Explanation exp = new Explanation( valSrcScore + subQueryExpl.getValue(), "custom score: sum of:");
      exp.addDetail(subQueryExpl);
      if (valSrcExpl != null) {
        exp.addDetail(valSrcExpl);
      }
      return exp;     
    }
  }
 
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

    public Explanation customExplain(int doc, Explanation subQueryExpl, Explanation valSrcExpls[]) {
      if (valSrcExpls.length == 0) {
        return subQueryExpl;
      }
      Explanation exp = new Explanation(valSrcExpls[0].getValue() + subQueryExpl.getValue(), "sum of:");
      exp.addDetail(subQueryExpl);
      exp.addDetail(valSrcExpls[0]);
      if (valSrcExpls.length == 1) {
        exp.setDescription("CustomMulAdd, sum of:");
        return exp;
      }
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

      if (valSrcExpls.length == 0) {
        return subQueryExpl;
      }
      Explanation exp = new Explanation(valSrcExpls[0].getValue() + subQueryExpl.getValue(), "sum of:");
      exp.addDetail(subQueryExpl);
      exp.addDetail(valSrcExpls[0]);
      if (valSrcExpls.length == 1) {
        exp.setDescription("CustomMulAdd, sum of:");
        return exp;
      }
      Explanation exp2 = new Explanation(valSrcExpls[1].getValue() * exp.getValue(), "custom score: product of:");
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

      if (valSrcExpls.length == 1) {
        exp.setDescription("CustomMulAdd, sum of:");
        return exp;
      }
      Explanation exp2 = new Explanation(valSrcExpls[1].getValue() * exp.getValue(), "custom score: product of:");
      exp2.addDetail(valSrcExpls[1]);
      exp2.addDetail(exp);
      return exp2;     
    }
  }
 
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

        exp.setDescription("CustomMulAdd, sum of:");
        return exp;
      }
      Explanation exp2 = new Explanation(valSrcExpls[1].getValue() * exp.getValue(), "custom score: product of:");
      exp2.addDetail(valSrcExpls[1]);
      exp2.addDetail(exp);
      return exp2;     
    }
  }
 
  // Test that FieldScoreQuery returns docs with expected score.
View Full Code Here

Examples of org.apache.lucene.search.Explanation.addDetail()

      }
      Explanation customExp = customExplain(doc,subQueryExpl,valSrcExpls);
      float sc = getValue() * customExp.getValue();
      Explanation res = new ComplexExplanation(
        true, sc, CustomScoreQuery.this.toString() + ", product of:");
      res.addDetail(customExp);
      res.addDetail(new Explanation(getValue(), "queryBoost")); // actually using the q boost as q weight (== weight value)
      return res;
    }

    public boolean scoresDocsOutOfOrder() {
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.