Package org.apache.lucene.search

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


   * @return an explanation for the custom score
   */
  public Explanation customExplain(int doc, Explanation subQueryExpl, Explanation valSrcExpl) {
    float valSrcScore = valSrcExpl==null ? 1 : valSrcExpl.getValue();
    Explanation exp = new Explanation( valSrcScore * subQueryExpl.getValue(), "custom score: product 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 ? 1 : valSrcExpl.getValue();
    Explanation exp = new Explanation( valSrcScore * subQueryExpl.getValue(), "custom score: product of:");
    exp.addDetail(subQueryExpl);
    if (valSrcExpl != null) {
      exp.addDetail(valSrcExpl);
    }
    return exp;
  }
  //=========================== W E I G H T ============================
 
View Full Code Here

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

View Full Code Here

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

  /*(non-Javadoc) @see org.apache.lucene.search.Query#createWeight(org.apache.lucene.search.Searcher) */
 
View Full Code Here

      float facetBoost = scorer.score(docid);

      Explanation facetExp = new Explanation();
      facetExp.setDescription(facetName);
      facetExp.setValue(facetBoost);
      facetExp.addDetail(scorer.explain(docid));
      boost *= facetBoost;
      exp.addDetail(facetExp);
    }
    exp.setValue(boost);
    exp.addDetail(innerExplaination);
View Full Code Here

           Explanation exp1 =  scorer.explain(docid);
           Explanation exp2 = new Explanation(getBoost(), "boost");
           Explanation expl = new Explanation();
           expl.setDescription("product of:");
           expl.setValue(exp1.getValue()*exp2.getValue());
           expl.addDetail(exp1);
           expl.addDetail(exp2);
           return expl;
         }
         else{
           return null;
View Full Code Here

           Explanation exp2 = new Explanation(getBoost(), "boost");
           Explanation expl = new Explanation();
           expl.setDescription("product of:");
           expl.setValue(exp1.getValue()*exp2.getValue());
           expl.addDetail(exp1);
           expl.addDetail(exp2);
           return expl;
         }
         else{
           return null;
         }
View Full Code Here

          explList.add(_function.explain(_dataCache.freqs[idx], _boostList[idx]));
        }
      }
      Explanation topLevel = _function.explain(scoreList.toFloatArray());
      for (Explanation sub : explList){
        topLevel.addDetail(sub);
      }
      return topLevel;
    }
   
    @Override
View Full Code Here

        count++;
        encoded >>>= 1;
      }
      Explanation topLevel = _function.explain(scoreList.toFloatArray());
      for (Explanation sub : explList){
        topLevel.addDetail(sub);
      }
      return topLevel;
    }
   
    @Override
View Full Code Here

          explList.add(_function.explain(_dataCache.freqs[idx], _boostList[idx]));
        }
      }
      Explanation topLevel = _function.explain(scoreList.toFloatArray());
      for (Explanation sub : explList){
        topLevel.addDetail(sub);
      }
      return topLevel;
    }
   
    @Override
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.