mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-03 01:19:10 +00:00
apply review comments
This commit is contained in:
parent
42af6c6db9
commit
df9432fcee
@ -36,7 +36,6 @@ import org.elasticsearch.common.unit.SizeValue;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -188,7 +188,7 @@ public class AnalysisService extends AbstractIndexComponent implements Closeable
|
||||
if (indicesAnalysisService != null) {
|
||||
for (Map.Entry<String, PreBuiltAnalyzerProviderFactory> entry : indicesAnalysisService.analyzerProviderFactories().entrySet()) {
|
||||
String name = entry.getKey();
|
||||
Version indexVersion = Version.indexCreated(this.indexSettings.getSettings());
|
||||
Version indexVersion = indexSettings.getIndexVersionCreated();
|
||||
if (!analyzerProviders.containsKey(name)) {
|
||||
analyzerProviders.put(name, entry.getValue().create(name, Settings.settingsBuilder().put(IndexMetaData.SETTING_VERSION_CREATED, indexVersion).build()));
|
||||
}
|
||||
@ -220,7 +220,7 @@ public class AnalysisService extends AbstractIndexComponent implements Closeable
|
||||
* and 100 afterwards so we override the positionIncrementGap if it
|
||||
* doesn't match here.
|
||||
*/
|
||||
int overridePositionIncrementGap = StringFieldMapper.Defaults.positionIncrementGap(Version.indexCreated(this.indexSettings.getSettings()));
|
||||
int overridePositionIncrementGap = StringFieldMapper.Defaults.positionIncrementGap(indexSettings.getIndexVersionCreated());
|
||||
if (analyzerFactory instanceof CustomAnalyzerProvider) {
|
||||
((CustomAnalyzerProvider) analyzerFactory).build(this);
|
||||
/*
|
||||
|
@ -77,7 +77,7 @@ public class CustomAnalyzerProvider extends AbstractIndexAnalyzerProvider<Custom
|
||||
tokenFilters.add(tokenFilter);
|
||||
}
|
||||
|
||||
int positionIncrementGap = StringFieldMapper.Defaults.positionIncrementGap(Version.indexCreated(indexSettings.getSettings()));
|
||||
int positionIncrementGap = StringFieldMapper.Defaults.positionIncrementGap(indexSettings.getIndexVersionCreated());
|
||||
|
||||
if (analyzerSettings.getAsMap().containsKey("position_offset_gap")){
|
||||
if (indexSettings.getIndexVersionCreated().before(Version.V_2_0_0)){
|
||||
|
@ -118,7 +118,7 @@ public class DocumentMapperParser {
|
||||
rootTypeParsers.put(FieldNamesFieldMapper.NAME, new FieldNamesFieldMapper.TypeParser());
|
||||
this.rootTypeParsers = unmodifiableMap(rootTypeParsers);
|
||||
additionalRootMappers = Collections.emptySortedMap();
|
||||
indexVersionCreated = Version.indexCreated(this.indexSettings);
|
||||
indexVersionCreated = indexSettings.getIndexVersionCreated();
|
||||
}
|
||||
|
||||
public void putTypeParser(String type, Mapper.TypeParser typeParser) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user