Search in sources :

Example 21 with FunctionScoreQueryBuilder

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

the class BsElevateWordToLabelCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<ElevateWordToLabelCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<ElevateWordToLabelCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    ElevateWordToLabelCQ cq = new ElevateWordToLabelCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            ElevateWordToLabelCQ cf = new ElevateWordToLabelCQ();
            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) ElevateWordToLabelCQ(org.codelibs.fess.es.config.cbean.cq.ElevateWordToLabelCQ)

Example 22 with FunctionScoreQueryBuilder

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

the class BsCrawlingInfoParamCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<CrawlingInfoParamCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<CrawlingInfoParamCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    CrawlingInfoParamCQ cq = new CrawlingInfoParamCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            CrawlingInfoParamCQ cf = new CrawlingInfoParamCQ();
            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) CrawlingInfoParamCQ(org.codelibs.fess.es.config.cbean.cq.CrawlingInfoParamCQ) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) ArrayList(java.util.ArrayList)

Example 23 with FunctionScoreQueryBuilder

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

the class BsFileAuthenticationCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<FileAuthenticationCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<FileAuthenticationCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    FileAuthenticationCQ cq = new FileAuthenticationCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            FileAuthenticationCQ cf = new FileAuthenticationCQ();
            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 : FileAuthenticationCQ(org.codelibs.fess.es.config.cbean.cq.FileAuthenticationCQ) FunctionScoreQueryBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) ArrayList(java.util.ArrayList)

Example 24 with FunctionScoreQueryBuilder

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

the class BsAccessTokenCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<AccessTokenCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<AccessTokenCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    AccessTokenCQ cq = new AccessTokenCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            AccessTokenCQ cf = new AccessTokenCQ();
            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) AccessTokenCQ(org.codelibs.fess.es.config.cbean.cq.AccessTokenCQ) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) ArrayList(java.util.ArrayList)

Example 25 with FunctionScoreQueryBuilder

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

the class BsBadWordCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<BadWordCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<BadWordCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    BadWordCQ cq = new BadWordCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            BadWordCQ cf = new BadWordCQ();
            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 : BadWordCQ(org.codelibs.fess.es.config.cbean.cq.BadWordCQ) FunctionScoreQueryBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) 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