public CodecService(@Nullable MapperService mapperService, Logger logger) { final MapBuilder<String, Codec> codecs = MapBuilder.<String, Codec>newMapBuilder(); if (mapperService == null) { codecs.put(DEFAULT_CODEC, new Lucene70Codec()); codecs.put(BEST_COMPRESSION_CODEC, new Lucene70Codec(Mode.BEST_COMPRESSION)); } else { codecs.put(DEFAULT_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_SPEED, mapperService, logger)); codecs.put(BEST_COMPRESSION_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_COMPRESSION, mapperService, logger)); } codecs.put(LUCENE_DEFAULT_CODEC, Codec.getDefault()); for (String codec : Codec.availableCodecs()) { codecs.put(codec, Codec.forName(codec)); } this.codecs = codecs.immutableMap(); }
return s; default: if (Codec.availableCodecs().contains(s) == false) { // we don't error message the not officially supported ones throw new IllegalArgumentException( "unknown value for [index.codec] must be one of [default, best_compression] but was: " + s);
public CodecService(@Nullable MapperService mapperService, Logger logger) { final MapBuilder<String, Codec> codecs = MapBuilder.<String, Codec>newMapBuilder(); if (mapperService == null) { codecs.put(DEFAULT_CODEC, new Lucene70Codec()); codecs.put(BEST_COMPRESSION_CODEC, new Lucene70Codec(Mode.BEST_COMPRESSION)); } else { codecs.put(DEFAULT_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_SPEED, mapperService, logger)); codecs.put(BEST_COMPRESSION_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_COMPRESSION, mapperService, logger)); } codecs.put(LUCENE_DEFAULT_CODEC, Codec.getDefault()); for (String codec : Codec.availableCodecs()) { codecs.put(codec, Codec.forName(codec)); } this.codecs = codecs.immutableMap(); }
private CodecService(Index index, Settings indexSettings, MapperService mapperService) { super(index, indexSettings); this.mapperService = mapperService; MapBuilder<String, Codec> codecs = MapBuilder.<String, Codec>newMapBuilder(); if (mapperService == null) { codecs.put(DEFAULT_CODEC, new Lucene54Codec()); codecs.put(BEST_COMPRESSION_CODEC, new Lucene54Codec(Mode.BEST_COMPRESSION)); } else { codecs.put(DEFAULT_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_SPEED, mapperService, logger)); codecs.put(BEST_COMPRESSION_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_COMPRESSION, mapperService, logger)); } codecs.put(LUCENE_DEFAULT_CODEC, Codec.getDefault()); for (String codec : Codec.availableCodecs()) { codecs.put(codec, Codec.forName(codec)); } this.codecs = codecs.immutableMap(); }
public CodecService(@Nullable MapperService mapperService, Logger logger) { final MapBuilder<String, Codec> codecs = MapBuilder.<String, Codec>newMapBuilder(); if (mapperService == null) { codecs.put(DEFAULT_CODEC, new Lucene62Codec()); codecs.put(BEST_COMPRESSION_CODEC, new Lucene62Codec(Mode.BEST_COMPRESSION)); } else { codecs.put(DEFAULT_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_SPEED, mapperService, logger)); codecs.put(BEST_COMPRESSION_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_COMPRESSION, mapperService, logger)); } codecs.put(LUCENE_DEFAULT_CODEC, Codec.getDefault()); for (String codec : Codec.availableCodecs()) { codecs.put(codec, Codec.forName(codec)); } this.codecs = codecs.immutableMap(); }
public CodecService(@Nullable MapperService mapperService, Logger logger) { final MapBuilder<String, Codec> codecs = MapBuilder.<String, Codec>newMapBuilder(); if (mapperService == null) { codecs.put(DEFAULT_CODEC, new Lucene70Codec()); codecs.put(BEST_COMPRESSION_CODEC, new Lucene70Codec(Mode.BEST_COMPRESSION)); } else { codecs.put(DEFAULT_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_SPEED, mapperService, logger)); codecs.put(BEST_COMPRESSION_CODEC, new PerFieldMappingPostingFormatCodec(Mode.BEST_COMPRESSION, mapperService, logger)); } codecs.put(LUCENE_DEFAULT_CODEC, Codec.getDefault()); for (String codec : Codec.availableCodecs()) { codecs.put(codec, Codec.forName(codec)); } this.codecs = codecs.immutableMap(); }