package cn.axzo.workflow.es.setting;

import com.google.common.collect.Lists;
import org.dromara.easyes.annotation.rely.DefaultSettingsProvider;

import java.util.HashMap;
import java.util.Map;

/**
 * 对索引这是自定义的 Settings
 *
 * @author wangli
 * @since 2024-10-12 10:00
 */
public class CustomIndexSettingProvider extends DefaultSettingsProvider {
    @Override
    public Map<String, Object> getSettings() {
        Map<String, Object> settings = new HashMap<>();
        settings.put("analysis.analyzer.ngram_analyzer.tokenizer", "ngram_tokenizer");
        settings.put("analysis.tokenizer.ngram_tokenizer.token_chars", Lists.newArrayList("letter", "digit"));
        settings.put("analysis.tokenizer.ngram_tokenizer.type", "ngram");
        return settings;
    }
}
