Search in sources :

Example 1 with WandItem

use of com.yahoo.prelude.query.WandItem in project vespa by vespa-engine.

the class YqlParser method buildWand.

@NonNull
private Item buildWand(OperatorNode<ExpressionOperator> ast) {
    List<OperatorNode<ExpressionOperator>> args = ast.getArgument(1);
    Preconditions.checkArgument(args.size() == 2, "Expected 2 arguments, got %s.", args.size());
    WandItem out = new WandItem(getIndex(args.get(0)), getAnnotation(ast, TARGET_NUM_HITS, Integer.class, DEFAULT_TARGET_NUM_HITS, "desired number of hits to accumulate in wand"));
    Double scoreThreshold = getAnnotation(ast, SCORE_THRESHOLD, Double.class, null, "min score for hit inclusion");
    if (scoreThreshold != null) {
        out.setScoreThreshold(scoreThreshold);
    }
    Double thresholdBoostFactor = getAnnotation(ast, THRESHOLD_BOOST_FACTOR, Double.class, null, "boost factor used to boost threshold before comparing against upper bound score");
    if (thresholdBoostFactor != null) {
        out.setThresholdBoostFactor(thresholdBoostFactor);
    }
    return fillWeightedSet(ast, args.get(1), out);
}
Also used : BigInteger(java.math.BigInteger) WandItem(com.yahoo.prelude.query.WandItem) NonNull(edu.umd.cs.findbugs.annotations.NonNull)

Aggregations

WandItem (com.yahoo.prelude.query.WandItem)1 NonNull (edu.umd.cs.findbugs.annotations.NonNull)1 BigInteger (java.math.BigInteger)1