Package org.apache.lucene.search

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


            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

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

    @Override
View Full Code Here

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

    @Override
    public boolean scoresDocsOutOfOrder() {
View Full Code Here

      }
      /* (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

      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;     
      }
    };
    q4CustomAdd.setStrict(true);
View Full Code Here

        return (1 + subQueryScore) * valSrcScore;
      }
      /* (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) {
        Explanation exp = new Explanation(1 + subQueryExpl.getValue(), "sum of:");
        exp.addDetail(subQueryExpl);
        exp.addDetail(new Explanation(1,"const 1"));
        if (valSrcExpl == null) {
          exp.setDescription("CustomMulAdd, sum of:");
          return exp;
        }
View Full Code Here

      }
      /* (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) {
        Explanation exp = new Explanation(1 + subQueryExpl.getValue(), "sum of:");
        exp.addDetail(subQueryExpl);
        exp.addDetail(new Explanation(1,"const 1"));
        if (valSrcExpl == null) {
          exp.setDescription("CustomMulAdd, sum of:");
          return exp;
        }
        Explanation exp2 = new Explanation(valSrcExpl.getValue() * exp.getValue(), "custom score: product of:");
View Full Code Here

        if (valSrcExpl == null) {
          exp.setDescription("CustomMulAdd, sum of:");
          return exp;
        }
        Explanation exp2 = new Explanation(valSrcExpl.getValue() * exp.getValue(), "custom score: product of:");
        exp2.addDetail(valSrcExpl);
        exp2.addDetail(exp);
        return exp2;     
      }
    };
    q5CustomMulAdd.setStrict(true);
View Full Code Here

          exp.setDescription("CustomMulAdd, sum of:");
          return exp;
        }
        Explanation exp2 = new Explanation(valSrcExpl.getValue() * exp.getValue(), "custom score: product of:");
        exp2.addDetail(valSrcExpl);
        exp2.addDetail(exp);
        return exp2;     
      }
    };
    q5CustomMulAdd.setStrict(true);
    q5CustomMulAdd.setBoost(boost);
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.