Package org.elasticsearch.index.query.functionscore

Examples of org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder


      return boolQuery;
    }
  }

  private QueryBuilder boost(QueryBuilder query) {
    FunctionScoreQueryBuilder booster = functionScoreQuery(query);

    booster.add(termFilter("is_comment", "false"), ScoreFunctionBuilders.factorFunction(TOPIC_BOOST));
    booster.add(rangeFilter("postdate").gte("now/d-3y"), ScoreFunctionBuilders.factorFunction(RECENT_BOOST));

    return booster;
  }
View Full Code Here


     * A query that allows to define a custom scoring function.
     *
     * @param queryBuilder The query to custom score
     */
    public static FunctionScoreQueryBuilder functionScoreQuery(QueryBuilder queryBuilder) {
        return new FunctionScoreQueryBuilder(queryBuilder);
    }
View Full Code Here

    /**
     * A query that allows to define a custom scoring function.
     */
    public static FunctionScoreQueryBuilder functionScoreQuery() {
        return new FunctionScoreQueryBuilder();
    }
View Full Code Here

     * A query that allows to define a custom scoring function.
     *
     * @param function The function builder used to custom score
     */
    public static FunctionScoreQueryBuilder functionScoreQuery(ScoreFunctionBuilder function) {
        return new FunctionScoreQueryBuilder(function);
    }
View Full Code Here

     *
     * @param queryBuilder The query to custom score
     * @param function     The function builder used to custom score
     */
    public static FunctionScoreQueryBuilder functionScoreQuery(QueryBuilder queryBuilder, ScoreFunctionBuilder function) {
        return (new FunctionScoreQueryBuilder(queryBuilder)).add(function);
    }
View Full Code Here

     *
     * @param filterBuilder The query to custom score
     * @param function      The function builder used to custom score
     */
    public static FunctionScoreQueryBuilder functionScoreQuery(FilterBuilder filterBuilder, ScoreFunctionBuilder function) {
        return (new FunctionScoreQueryBuilder(filterBuilder)).add(function);
    }
View Full Code Here

     * A query that allows to define a custom scoring function.
     *
     * @param filterBuilder The filterBuilder to custom score
     */
    public static FunctionScoreQueryBuilder functionScoreQuery(FilterBuilder filterBuilder) {
        return new FunctionScoreQueryBuilder(filterBuilder);
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder

Copyright © 2018 www.massapicom. 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.