当前位置: 首页>>代码示例>>Java>>正文


Java Settings.getAsBooleanLenientForPreEs6Indices方法代码示例

本文整理汇总了Java中org.elasticsearch.common.settings.Settings.getAsBooleanLenientForPreEs6Indices方法的典型用法代码示例。如果您正苦于以下问题:Java Settings.getAsBooleanLenientForPreEs6Indices方法的具体用法?Java Settings.getAsBooleanLenientForPreEs6Indices怎么用?Java Settings.getAsBooleanLenientForPreEs6Indices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.settings.Settings的用法示例。


在下文中一共展示了Settings.getAsBooleanLenientForPreEs6Indices方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CJKBigramFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public CJKBigramFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    outputUnigrams = settings.getAsBooleanLenientForPreEs6Indices(
        indexSettings.getIndexVersionCreated(), "output_unigrams", false, deprecationLogger);
    final String[] asArray = settings.getAsArray("ignored_scripts");
    Set<String> scripts = new HashSet<>(Arrays.asList("han", "hiragana", "katakana", "hangul"));
    if (asArray != null) {
        scripts.removeAll(Arrays.asList(asArray));
    }
    int flags = 0;
    for (String script : scripts) {
        if ("han".equals(script)) {
            flags |= CJKBigramFilter.HAN;
        } else if ("hiragana".equals(script)) {
            flags |= CJKBigramFilter.HIRAGANA;
        } else if ("katakana".equals(script)) {
            flags |= CJKBigramFilter.KATAKANA;
        } else if ("hangul".equals(script)) {
            flags |= CJKBigramFilter.HANGUL;
        }
    }
    this.flags = flags;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:24,代码来源:CJKBigramFilterFactory.java

示例2: PathHierarchyTokenizerFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public PathHierarchyTokenizerFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    bufferSize = settings.getAsInt("buffer_size", 1024);
    String delimiter = settings.get("delimiter");
    if (delimiter == null) {
        this.delimiter = PathHierarchyTokenizer.DEFAULT_DELIMITER;
    } else if (delimiter.length() > 1) {
        throw new IllegalArgumentException("delimiter can only be a one char value");
    } else {
        this.delimiter = delimiter.charAt(0);
    }

    String replacement = settings.get("replacement");
    if (replacement == null) {
        this.replacement = this.delimiter;
    } else if (replacement.length() > 1) {
        throw new IllegalArgumentException("replacement can only be a one char value");
    } else {
        this.replacement = replacement.charAt(0);
    }
    this.skip = settings.getAsInt("skip", PathHierarchyTokenizer.DEFAULT_SKIP);
    this.reverse =
        settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "reverse", false, deprecationLogger);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:25,代码来源:PathHierarchyTokenizerFactory.java

示例3: BM25SimilarityProvider

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public BM25SimilarityProvider(String name, Settings settings, Settings indexSettings) {
    super(name);
    float k1 = settings.getAsFloat("k1", 1.2f);
    float b = settings.getAsFloat("b", 0.75f);
    final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger(getClass()));
    boolean discountOverlaps =
        settings.getAsBooleanLenientForPreEs6Indices(Version.indexCreated(indexSettings), "discount_overlaps", true, deprecationLogger);

    this.similarity = new BM25Similarity(k1, b);
    this.similarity.setDiscountOverlaps(discountOverlaps);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:BM25SimilarityProvider.java

示例4: DFISimilarityProvider

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public DFISimilarityProvider(String name, Settings settings, Settings indexSettings) {
    super(name);
    boolean discountOverlaps = settings.getAsBooleanLenientForPreEs6Indices(
        Version.indexCreated(indexSettings), "discount_overlaps", true, new DeprecationLogger(ESLoggerFactory.getLogger(getClass())));
    Independence measure = parseIndependence(settings);
    this.similarity = new DFISimilarity(measure);
    this.similarity.setDiscountOverlaps(discountOverlaps);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:DFISimilarityProvider.java

示例5: KuromojiIterationMarkCharFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public KuromojiIterationMarkCharFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name);
    normalizeKanji = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "normalize_kanji",
        JapaneseIterationMarkCharFilter.NORMALIZE_KANJI_DEFAULT, deprecationLogger);
    normalizeKana = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "normalize_kana",
        JapaneseIterationMarkCharFilter.NORMALIZE_KANA_DEFAULT, deprecationLogger);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:KuromojiIterationMarkCharFilterFactory.java

示例6: ShingleTokenFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public ShingleTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    Integer maxShingleSize = settings.getAsInt("max_shingle_size", ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE);
    Integer minShingleSize = settings.getAsInt("min_shingle_size", ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE);
    Boolean outputUnigrams = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "output_unigrams", true, deprecationLogger);
    Boolean outputUnigramsIfNoShingles = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "output_unigrams_if_no_shingles", false, deprecationLogger);
    String tokenSeparator = settings.get("token_separator", ShingleFilter.DEFAULT_TOKEN_SEPARATOR);
    String fillerToken = settings.get("filler_token", ShingleFilter.DEFAULT_FILLER_TOKEN);
    factory = new Factory("shingle", minShingleSize, maxShingleSize, outputUnigrams, outputUnigramsIfNoShingles, tokenSeparator, fillerToken);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:ShingleTokenFilterFactory.java

示例7: JapaneseStopTokenFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public JapaneseStopTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    this.ignoreCase = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "ignore_case", false, deprecationLogger);
    this.removeTrailing = settings
        .getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "remove_trailing", true, deprecationLogger);
    this.stopWords = Analysis.parseWords(env, settings, "stopwords", JapaneseAnalyzer.getDefaultStopSet(), NAMED_STOP_WORDS, ignoreCase);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:JapaneseStopTokenFilterFactory.java

示例8: PatternCaptureGroupTokenFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public PatternCaptureGroupTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    String[] regexes = settings.getAsArray(PATTERNS_KEY, null, false);
    if (regexes == null) {
        throw new IllegalArgumentException("required setting '" + PATTERNS_KEY + "' is missing for token filter [" + name + "]");
    }
    patterns = new Pattern[regexes.length];
    for (int i = 0; i < regexes.length; i++) {
        patterns[i] = Pattern.compile(regexes[i]);
    }

    preserveOriginal = settings.getAsBooleanLenientForPreEs6Indices(
        indexSettings.getIndexVersionCreated(), PRESERVE_ORIG_KEY, true, deprecationLogger);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:PatternCaptureGroupTokenFilterFactory.java

示例9: KuromojiTokenizerFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public KuromojiTokenizerFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    mode = getMode(settings);
    userDictionary = getUserDictionary(env, settings);
    discartPunctuation = settings
        .getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "discard_punctuation", true, deprecationLogger);
    nBestCost = settings.getAsInt(NBEST_COST, -1);
    nBestExamples = settings.get(NBEST_EXAMPLES);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:KuromojiTokenizerFactory.java

示例10: getWordSet

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public static CharArraySet getWordSet(Environment env, org.elasticsearch.Version indexCreatedVersion, Settings settings,
                                      String settingsPrefix) {
    List<String> wordList = getWordList(env, settings, settingsPrefix);
    if (wordList == null) {
        return null;
    }
    boolean ignoreCase =
        settings.getAsBooleanLenientForPreEs6Indices(indexCreatedVersion, settingsPrefix + "_case", false, deprecationLogger);
    return new CharArraySet(wordList, ignoreCase);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:Analysis.java

示例11: KeywordMarkerTokenFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public KeywordMarkerTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);

    boolean ignoreCase =
        settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "ignore_case", false, deprecationLogger);
    Set<?> rules = Analysis.getWordSet(env, indexSettings.getIndexVersionCreated(), settings, "keywords");
    if (rules == null) {
        throw new IllegalArgumentException("keyword filter requires either `keywords` or `keywords_path` to be configured");
    }
    keywordLookup = new CharArraySet(rules, ignoreCase);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:KeywordMarkerTokenFilterFactory.java

示例12: ClassicSimilarityProvider

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public ClassicSimilarityProvider(String name, Settings settings, Settings indexSettings) {
    super(name);
    boolean discountOverlaps = settings.getAsBooleanLenientForPreEs6Indices(
        Version.indexCreated(indexSettings), "discount_overlaps", true, new DeprecationLogger(ESLoggerFactory.getLogger(getClass())));
    this.similarity.setDiscountOverlaps(discountOverlaps);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:ClassicSimilarityProvider.java

示例13: ASCIIFoldingTokenFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public ASCIIFoldingTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    preserveOriginal = settings.getAsBooleanLenientForPreEs6Indices(
        indexSettings.getIndexVersionCreated(), PRESERVE_ORIGINAL.getPreferredName(), DEFAULT_PRESERVE_ORIGINAL, deprecationLogger);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:ASCIIFoldingTokenFilterFactory.java

示例14: UniqueTokenFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public UniqueTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    this.onlyOnSamePosition = settings.getAsBooleanLenientForPreEs6Indices(
        indexSettings.getIndexVersionCreated(), "only_on_same_position", false, deprecationLogger);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:UniqueTokenFilterFactory.java

示例15: KuromojiReadingFormFilterFactory

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public KuromojiReadingFormFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    useRomaji =
        settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "use_romaji", false, deprecationLogger);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:KuromojiReadingFormFilterFactory.java


注:本文中的org.elasticsearch.common.settings.Settings.getAsBooleanLenientForPreEs6Indices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。