Search in sources :

Example 26 with FilterFunctionBuilder

use of org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.

the class BsPathMappingCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<PathMappingCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<PathMappingCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    PathMappingCQ cq = new PathMappingCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            PathMappingCQ cf = new PathMappingCQ();
            cqLambda.callback(cf);
            list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
        });
    }
    final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
Also used : FunctionScoreQueryBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder) PathMappingCQ(org.codelibs.fess.es.config.cbean.cq.PathMappingCQ) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) ArrayList(java.util.ArrayList)

Example 27 with FilterFunctionBuilder

use of org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.

the class BsRequestHeaderCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<RequestHeaderCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<RequestHeaderCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    RequestHeaderCQ cq = new RequestHeaderCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            RequestHeaderCQ cf = new RequestHeaderCQ();
            cqLambda.callback(cf);
            list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
        });
    }
    final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
Also used : RequestHeaderCQ(org.codelibs.fess.es.config.cbean.cq.RequestHeaderCQ) FunctionScoreQueryBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) ArrayList(java.util.ArrayList)

Example 28 with FilterFunctionBuilder

use of org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.

the class BsLabelTypeCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<LabelTypeCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<LabelTypeCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    LabelTypeCQ cq = new LabelTypeCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            LabelTypeCQ cf = new LabelTypeCQ();
            cqLambda.callback(cf);
            list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
        });
    }
    final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
Also used : FunctionScoreQueryBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) ArrayList(java.util.ArrayList) LabelTypeCQ(org.codelibs.fess.es.config.cbean.cq.LabelTypeCQ)

Example 29 with FilterFunctionBuilder

use of org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.

the class BsRelatedContentCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<RelatedContentCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<RelatedContentCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    RelatedContentCQ cq = new RelatedContentCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            RelatedContentCQ cf = new RelatedContentCQ();
            cqLambda.callback(cf);
            list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
        });
    }
    final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
Also used : FunctionScoreQueryBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder) RelatedContentCQ(org.codelibs.fess.es.config.cbean.cq.RelatedContentCQ) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) ArrayList(java.util.ArrayList)

Example 30 with FilterFunctionBuilder

use of org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.

the class BsRoleTypeCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<RoleTypeCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<RoleTypeCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    RoleTypeCQ cq = new RoleTypeCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            RoleTypeCQ cf = new RoleTypeCQ();
            cqLambda.callback(cf);
            list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
        });
    }
    final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
Also used : FunctionScoreQueryBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) RoleTypeCQ(org.codelibs.fess.es.config.cbean.cq.RoleTypeCQ) ArrayList(java.util.ArrayList)

Aggregations

FunctionScoreQueryBuilder (org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder)34 FilterFunctionBuilder (org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder)34 ArrayList (java.util.ArrayList)31 AccessTokenCQ (org.codelibs.fess.es.config.cbean.cq.AccessTokenCQ)1 BadWordCQ (org.codelibs.fess.es.config.cbean.cq.BadWordCQ)1 BoostDocumentRuleCQ (org.codelibs.fess.es.config.cbean.cq.BoostDocumentRuleCQ)1 CrawlingInfoCQ (org.codelibs.fess.es.config.cbean.cq.CrawlingInfoCQ)1 CrawlingInfoParamCQ (org.codelibs.fess.es.config.cbean.cq.CrawlingInfoParamCQ)1 DataConfigCQ (org.codelibs.fess.es.config.cbean.cq.DataConfigCQ)1 DuplicateHostCQ (org.codelibs.fess.es.config.cbean.cq.DuplicateHostCQ)1 ElevateWordCQ (org.codelibs.fess.es.config.cbean.cq.ElevateWordCQ)1 ElevateWordToLabelCQ (org.codelibs.fess.es.config.cbean.cq.ElevateWordToLabelCQ)1 FailureUrlCQ (org.codelibs.fess.es.config.cbean.cq.FailureUrlCQ)1 FileAuthenticationCQ (org.codelibs.fess.es.config.cbean.cq.FileAuthenticationCQ)1 FileConfigCQ (org.codelibs.fess.es.config.cbean.cq.FileConfigCQ)1 JobLogCQ (org.codelibs.fess.es.config.cbean.cq.JobLogCQ)1 KeyMatchCQ (org.codelibs.fess.es.config.cbean.cq.KeyMatchCQ)1 LabelTypeCQ (org.codelibs.fess.es.config.cbean.cq.LabelTypeCQ)1 PathMappingCQ (org.codelibs.fess.es.config.cbean.cq.PathMappingCQ)1 RelatedContentCQ (org.codelibs.fess.es.config.cbean.cq.RelatedContentCQ)1