Found issue with hidden files attempting to be indexed when mappings being loaded. This allows mappings to skip hidden files.

failed to read / parse mapping [] from location [/opt/elastic/current/config/mappings/n233/.svn], ignoring...
java.io.FileNotFoundException: /opt/elastic/current/config/mappings/n233/.svn (Is a directory)
        at java.io.FileInputStream.open(Native Method)
This commit is contained in:
Bobby T 2011-05-26 15:45:09 -05:00 committed by kimchy
parent 3e6a6ffd35
commit d299672545
1 changed files with 3 additions and 0 deletions

View File

@ -367,6 +367,9 @@ public class MetaDataCreateIndexService extends AbstractComponent {
private void addMappings(Map<String, Map<String, Object>> mappings, File mappingsDir) {
File[] mappingsFiles = mappingsDir.listFiles();
for (File mappingFile : mappingsFiles) {
if (mappingFile.isHidden()) {
continue;
}
String mappingType = mappingFile.getName().substring(0, mappingFile.getName().lastIndexOf('.'));
try {
String mappingSource = Streams.copyToString(new FileReader(mappingFile));