This commit is contained in:
Victor Shcherb 2012-01-08 23:32:36 +01:00
parent 2914df8cb7
commit a91934bee6

View file

@ -147,7 +147,12 @@ public class WikiIndexer {
BufferedWriter out = null; BufferedWriter out = null;
try { try {
int in = f.getName().indexOf('.'); int in = f.getName().indexOf('.');
String wikiLocale = f.getName().substring(in + 1, f.getName().indexOf('.', in)); int in2 = f.getName().indexOf('.', in + 1);
if (in2 == -1) {
log.error("File was not processed " + f.getName() + " please use name <Index-name>.<2Letters-Locale>.xml.bz2");
return null;
}
String wikiLocale = f.getName().substring(in + 1, in2);
log.info("Locale for file " + wikiLocale); log.info("Locale for file " + wikiLocale);
PreparedStatement statement = dbConnection.prepareStatement("SELECT gc_lat, gc_lon, gc_type FROM coord_"+wikiLocale+"wiki WHERE gc_from=?"); PreparedStatement statement = dbConnection.prepareStatement("SELECT gc_lat, gc_lon, gc_type FROM coord_"+wikiLocale+"wiki WHERE gc_from=?");