[mb-commits] r12435 - in search_server/branches/ngs: . index/src/main/java/org/musicbrainz/search/index

root at musicbrainz.org root at musicbrainz.org
Thu Jan 7 20:59:16 UTC 2010


Author: ijabz
Date: 2010-01-07 20:59:16 +0000 (Thu, 07 Jan 2010)
New Revision: 12435

Modified:
   search_server/branches/ngs/README
   search_server/branches/ngs/index/src/main/java/org/musicbrainz/search/index/IndexBuilder.java
Log:
SEARCH-5 #close fixed #comment Modified how the freeddb options work so more intuitive and modified README accordingly.

i.e 
java -jar index-1.0-SNAPSHOT-jar-with-dependencies.jar (Build all indexes except freedb)
java -jar index-1.0-SNAPSHOT-jar-with-dependencies.jar --freeddb-dump dumpfile  (Build all indexes including freedb )
java -jar index-1.0-SNAPSHOT-jar-with-dependencies.jar --indexes freedb --freeddb-dump dumpfile  (Build only freedb index)
java -jar index-1.0-SNAPSHOT-jar-with-dependencies.jar --indexes freedb,release --freeddb-dump dumpfile  (Build release and freedb index)

Modified: search_server/branches/ngs/README
===================================================================
--- search_server/branches/ngs/README	2010-01-07 19:57:46 UTC (rev 12434)
+++ search_server/branches/ngs/README	2010-01-07 20:59:16 UTC (rev 12435)
@@ -117,11 +117,8 @@
 
 It is worth noting that if you want to build _just_ the freedb_index, you can specify
 
-      --indexes ""
+      --indexes freedb
 
-but if you do that you'll still need to specify all the database connection details, even though they 
-won't be used (this might be a bug -- we're looking into this).
-
 Building the search indexes will take some time -- even on a fast machine it will still take an hour.
 Once indexes are built, ensure that your tomcat instance has the permissions to access your data. 
 In Ubuntu:

Modified: search_server/branches/ngs/index/src/main/java/org/musicbrainz/search/index/IndexBuilder.java
===================================================================
--- search_server/branches/ngs/index/src/main/java/org/musicbrainz/search/index/IndexBuilder.java	2010-01-07 19:57:46 UTC (rev 12434)
+++ search_server/branches/ngs/index/src/main/java/org/musicbrainz/search/index/IndexBuilder.java	2010-01-07 20:59:16 UTC (rev 12435)
@@ -152,13 +152,16 @@
         if(options.buildIndex("freedb")) {
 
             File dumpFile = new File(options.getFreeDBDump());
-            if (dumpFile != null && dumpFile.isFile()) {
-                clock.start();
-                buildFreeDBIndex(dumpFile, options);
-                clock.stop();
-                System.out.println("  Finished in " + Float.toString(clock.getTime()/1000) + " seconds");
-            } else {
-                System.out.println("  Can't build FreeDB index: invalid file");
+            //If they have set freedbdump file 
+            if (options.getFreeDBDump() != null && options.getFreeDBDump().length()!=0)  {
+                if( dumpFile.isFile()) {
+                    clock.start();
+                    buildFreeDBIndex(dumpFile, options);
+                    clock.stop();
+                    System.out.println("  Finished in " + Float.toString(clock.getTime()/1000) + " seconds");
+                } else {
+                    System.out.println("  Can't build FreeDB index: invalid file "+options.getFreeDBDump());
+                }
             }
         }
     }
@@ -334,8 +337,8 @@
     public String getFreeDBDump() { return freeDBDump; }
 
     // Selection of indexes to build
-    @Option(name="--indexes", usage="A comma-separated list of indexes to build (artist,releasegroup,release,recording,label,work,annotation,cdstub)")
-    private String indexes = "artist,label,release,recording,releasegroup,work,annotation,cdstub";
+    @Option(name="--indexes", usage="A comma-separated list of indexes to build (artist,releasegroup,release,recording,label,work,annotation,cdstub,freedb)")
+    private String indexes = "artist,label,release,recording,releasegroup,work,annotation,cdstub,freedb";
     public ArrayList<String> selectedIndexes() { return new ArrayList<String>(Arrays.asList(indexes.split(","))); }
     public boolean buildIndex(String indexName) { return selectedIndexes().contains(indexName); }
 




More information about the MusicBrainz-commits mailing list