mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 18:35:25 +00:00
Support files with no extension in config mappings
This commit is contained in:
parent
a63aa6cc18
commit
0a5a068269
@ -415,7 +415,8 @@ public class MetaDataCreateIndexService extends AbstractComponent {
|
||||
if (mappingFile.isHidden()) {
|
||||
continue;
|
||||
}
|
||||
String mappingType = mappingFile.getName().substring(0, mappingFile.getName().lastIndexOf('.'));
|
||||
int lastDotIndex = mappingFile.getName().lastIndexOf('.');
|
||||
String mappingType = lastDotIndex != -1 ? mappingFile.getName().substring(0, lastDotIndex) : mappingFile.getName();
|
||||
try {
|
||||
String mappingSource = Streams.copyToString(new FileReader(mappingFile));
|
||||
if (mappings.containsKey(mappingType)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user