package com.arms.egovframework.javaservice.esframework.esquery.must;

import org.opensearch.index.query.*;
import org.springframework.util.ObjectUtils;

public class MoreLikeThisMust extends Must<MoreLikeThisQueryBuilder> {

    private MoreLikeThisQueryBuilder moreLikeThisQueryBuilder;

    public MoreLikeThisMust(String[] texts, String[] fields){
        if(!ObjectUtils.isEmpty(texts)){
            this.moreLikeThisQueryBuilder
                = QueryBuilders.moreLikeThisQuery(texts,fields,null);
        }
    }

    @Override
    public AbstractQueryBuilder<MoreLikeThisQueryBuilder> abstractQueryBuilder() {
        return moreLikeThisQueryBuilder;
    }
}
