org.elasticsearch.common.settings.Settings.getAsBooleanLenientForPreEs6Indices()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(12.1k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中org.elasticsearch.common.settings.Settings.getAsBooleanLenientForPreEs6Indices()方法的一些代码示例,展示了Settings.getAsBooleanLenientForPreEs6Indices()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Settings.getAsBooleanLenientForPreEs6Indices()方法的具体详情如下:
包路径:org.elasticsearch.common.settings.Settings
类名称:Settings
方法名:getAsBooleanLenientForPreEs6Indices

Settings.getAsBooleanLenientForPreEs6Indices介绍

[英]Returns the setting value (as boolean) associated with the setting key. If it does not exist, returns the default value provided. If the index was created on Elasticsearch below 6.0, booleans will be parsed leniently otherwise they are parsed strictly. See Booleans#isBooleanLenient(char[],int,int) for the definition of a "lenient boolean" and Booleans#isBoolean(char[],int,int) for the definition of a "strict boolean".
[中]返回与设置键关联的设置值(布尔值)。如果不存在,则返回提供的默认值。如果索引是在低于6.0的Elasticsearch上创建的,布尔值将被轻松解析,否则它们将被严格解析。有关“宽松布尔”的定义,请参见Booleans#isBooleanLenient(char[],int,int),有关“严格布尔”的定义,请参见Booleans#isBoolean(char[],int,int)。

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

public static CharArraySet parseStopWords(Environment env, org.elasticsearch.Version indexCreatedVersion, Settings settings,
                     CharArraySet defaultStopWords) {
  boolean stopwordsCase =
    settings.getAsBooleanLenientForPreEs6Indices(indexCreatedVersion, "stopwords_case", false, deprecationLogger);
  return parseStopWords(env, settings, defaultStopWords, stopwordsCase);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

public static CharArraySet parseArticles(Environment env, org.elasticsearch.Version indexCreatedVersion, Settings settings) {
  boolean articlesCase = settings.getAsBooleanLenientForPreEs6Indices(indexCreatedVersion, "articles_case", false, deprecationLogger);
  return parseWords(env, settings, "articles", null, null, articlesCase);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

public StopTokenFilterFactory(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.parseStopWords(env, settings, StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase);
  if (settings.get("enable_position_increments") != null) {
    throw new IllegalArgumentException("enable_position_increments is not supported anymore. Please fix your analysis chain");
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

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);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

public HunspellTokenFilterFactory(IndexSettings indexSettings, String name, Settings settings, HunspellService hunspellService) {
  super(indexSettings, name, settings);
  String locale = settings.get("locale", settings.get("language", settings.get("lang", null)));
  if (locale == null) {
    throw new IllegalArgumentException("missing [locale | language | lang] configuration for hunspell token filter");
  }
  dictionary = hunspellService.getDictionary(locale);
  if (dictionary == null) {
    throw new IllegalArgumentException(String.format(Locale.ROOT, "Unknown hunspell dictionary for locale [%s]", locale));
  }
  dedup = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "dedup", true, deprecationLogger);
  longestOnly =
    settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "longest_only", false, deprecationLogger);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

public ShingleTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
  super(indexSettings, name, settings);
  int maxAllowedShingleDiff = indexSettings.getMaxShingleDiff();
  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);
  int shingleDiff = maxShingleSize - minShingleSize + (outputUnigrams ? 1 : 0);
  if (shingleDiff > maxAllowedShingleDiff) {
    deprecationLogger.deprecated("Deprecated big difference between maxShingleSize and minShingleSize in Shingle TokenFilter,"
      + "expected difference must be less than or equal to: [" + maxAllowedShingleDiff + "]");
  }
  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);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "ignore_case", false, deprecationLogger);
if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_6_0_0_beta1) && settings.get("ignore_case") != null) {
  deprecationLogger.deprecated(
  settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "expand", true, deprecationLogger);

代码示例来源:origin: org.elasticsearch/elasticsearch

double reclaimDeletesWeight = indexSettings.getValue(INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING);
double deletesPctAllowed = indexSettings.getValue(INDEX_MERGE_POLICY_DELETES_PCT_ALLOWED_SETTING);
this.mergesEnabled = indexSettings.getSettings().getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(),
  INDEX_MERGE_ENABLED, true, new DeprecationLogger(logger));
if (mergesEnabled == false) {

代码示例来源:origin: org.codelibs/elasticsearch-analysis-kuromoji-neologd

public KuromojiReadingFormFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
  super(indexSettings, name, settings);
  useRomaji =
    settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "use_romaji", false, deprecationLogger);
}

代码示例来源:origin: org.codelibs.elasticsearch.module/analysis-common

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);
}

代码示例来源:origin: apache/servicemix-bundles

public static CharArraySet parseStopWords(Environment env, org.elasticsearch.Version indexCreatedVersion, Settings settings,
                     CharArraySet defaultStopWords) {
  boolean stopwordsCase =
    settings.getAsBooleanLenientForPreEs6Indices(indexCreatedVersion, "stopwords_case", false, deprecationLogger);
  return parseStopWords(env, settings, defaultStopWords, stopwordsCase);
}

代码示例来源:origin: org.codelibs.elasticsearch.module/analysis-common

public int getFlag(int flag, Settings settings, String key, boolean defaultValue) {
  if (settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(),
      key, defaultValue, deprecationLogger)) {
    return flag;
  }
  return 0;
}

代码示例来源:origin: org.codelibs/elasticsearch-analysis-kuromoji-neologd

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);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public static CharArraySet parseStopWords(Environment env, org.elasticsearch.Version indexCreatedVersion, Settings settings,
                     CharArraySet defaultStopWords) {
  boolean stopwordsCase =
    settings.getAsBooleanLenientForPreEs6Indices(indexCreatedVersion, "stopwords_case", false, deprecationLogger);
  return parseStopWords(env, settings, defaultStopWords, stopwordsCase);
}

代码示例来源:origin: org.codelibs.elasticsearch.module/analysis-common

CommonGramsTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
  super(indexSettings, name, settings);
  this.ignoreCase = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(),
      "ignore_case", false, deprecationLogger);
  this.queryMode = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(),
      "query_mode", false, deprecationLogger);
  this.words = Analysis.parseCommonWords(env, settings, null, ignoreCase);
  if (this.words == null) {
    throw new IllegalArgumentException(
        "missing or empty [common_words] or [common_words_path] configuration for common_grams token filter");
  }
}

代码示例来源:origin: org.codelibs.elasticsearch.module/analysis-common

LimitTokenCountFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
  super(indexSettings, name, settings);
  this.maxTokenCount = settings.getAsInt("max_token_count", DEFAULT_MAX_TOKEN_COUNT);
  this.consumeAllTokens = settings.getAsBooleanLenientForPreEs6Indices(
    indexSettings.getIndexVersionCreated(), "consume_all_tokens", DEFAULT_CONSUME_ALL_TOKENS, deprecationLogger);
}

代码示例来源:origin: apache/servicemix-bundles

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);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

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);
}

代码示例来源:origin: org.codelibs.elasticsearch.module/analysis-common

public PatternReplaceTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
  super(indexSettings, name, settings);
  String sPattern = settings.get("pattern", null);
  if (sPattern == null) {
    throw new IllegalArgumentException("pattern is missing for [" + name + "] token filter of type 'pattern_replace'");
  }
  this.pattern = Regex.compile(sPattern, settings.get("flags"));
  this.replacement = settings.get("replacement", "");
  this.all = settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "all", true, deprecationLogger);
}

代码示例来源:origin: org.codelibs/elasticsearch-analysis-kuromoji-neologd

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);
}

相关文章