Search in sources :

Example 11 with FilterFunctionBuilder

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

the class BsDataConfigCQ method functionScore.

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

Example 12 with FilterFunctionBuilder

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

the class BsBoostDocumentRuleCQ method functionScore.

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

Example 13 with FilterFunctionBuilder

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

the class BsElevateWordCQ method functionScore.

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

Example 14 with FilterFunctionBuilder

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

the class BsFileConfigCQ method functionScore.

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

Example 15 with FilterFunctionBuilder

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

the class BsFailureUrlCQ method functionScore.

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