@Override
public void apply(final PositionSequence<Term> sequence, final TermMatches termMatches,
final int startPosition, final int endPosition, final ExpandedQuery expandedQuery,
final Map<String, Object> context) {
final QuerqyQuery<?> q = (hasPlaceHolder)
? new CloneAndReplacePlaceHolderRewriter(termMatches).cloneAndReplace(query)
: query.clone(null, true);
final BoostQuery bq = new BoostQuery(q, boost);
if (direction == BoostDirection.DOWN) {
expandedQuery.addBoostDownQuery(bq);
} else {
expandedQuery.addBoostUpQuery(bq);
}
}