package com.ruoyi.framework.config.properties;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 读取yml中es的配置信息和设置存储索引的分片数量和副本数量  :es 配置类
 */
@Data
@Configuration
@ConditionalOnExpression("!'${elasticsearch}'.isEmpty()")
@ConfigurationProperties(prefix = "elasticsearch")
public class ElasticSearchConfig {
    //ES地址
    private String ip;
    //端口
    private Integer port;
    //访问方式 http 或 tcp
    private String type;
    //默认全局索引
    private String defaultIndex;
    //副本数
    private int numberOfReplicas;
    //分片数
    private int numberOfShards;
    //搜索超时时间
    private int searchTimeOut;
    //主分片设置的超时时长
    private int masterShardTimeOut;
}
