Search in sources :

Example 1 with FunctionScoreQueryBuilder

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

the class BsThumbnailQueueCQ method functionScore.

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

Example 2 with FunctionScoreQueryBuilder

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

the class BsRelatedQueryCQ method functionScore.

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

Example 3 with FunctionScoreQueryBuilder

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

the class BsScheduledJobCQ method functionScore.

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

Example 4 with FunctionScoreQueryBuilder

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

the class BsUserCQ method functionScore.

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

Example 5 with FunctionScoreQueryBuilder

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

the class BsSearchLogCQ method functionScore.

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

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