lib/query-builder.js
function boost() {
  var args = mlutil.asArray.apply(null, arguments);
  switch(args.length) {
  case 0:
    throw new Error('missing matching and boosting queries');
  case 1:
    throw new Error('has matching but missing boosting query: '+mlutil.identify(args[0], true));
  case 2:
    return new BoostDef(new MatchingBoostingDef(args[0], args[1]));
  default:
    throw new Error('too many arguments for boost(): '+args.length);
  }
}
function boost() {
  var args = mlutil.asArray.apply(null, arguments);
  switch(args.length) {
  case 0:
    throw new Error('missing matching and boosting queries');
  case 1:
    throw new Error('has matching but missing boosting query: '+mlutil.identify(args[0], true));
  case 2:
    return new BoostDef(new MatchingBoostingDef(args[0], args[1]));
  default:
    throw new Error('too many arguments for boost(): '+args.length);
  }
}
function boost ( ) { var args = mlutil . asArray . apply ( null , arguments ) ; switch ( args . length ) { case 0 : throw new Error ( 'missing matching and boosting queries' ) ; case 1 : throw new Error ( 'has matching but missing boosting query: ' + mlutil . identify ( args [ 0 ] , true ) ) ; case 2 : return new BoostDef ( new MatchingBoostingDef ( args [ 0 ] , args [ 1 ] ) ) ; default : throw new Error ( 'too many arguments for boost(): ' + args . length ) ; } }
Builds a query with matching and boosting subqueries.
@method
@since 1.0
@memberof queryBuilder#
@param {queryBuilder.Query} matchingQuery - a query that must match
the result documents
@param {queryBuilder.Query} boostingQuery - a query that increases
the ranking when qualifying result documents
@returns {queryBuilder.Query} a composable query
Builds a query with matching and boosting subqueries .