r13745 - in search_server/trunk/index/src: main/java/org/musicbrainz/search/index test/java/org/musicbrainz/search/index

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

r13745 - in search_server/trunk/index/src: main/java/org/musicbrainz/search/index test/java/org/musicbrainz/search/index

root-9
Author: ijabz
Date: 2014-04-28 14:07:55 +0000 (Mon, 28 Apr 2014)
New Revision: 13745

Added:
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/EditorIndex.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/EditorIndexField.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/EditorIndexTest.java
Modified:
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/IndexBuilder.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/IndexOptions.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AbstractIndexTest.java
Log:
SEARCH-265:Add editors to the indexed search

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/IndexBuilder.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/IndexBuilder.java 2014-04-28 12:27:12 UTC (rev 13744)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/IndexBuilder.java 2014-04-28 14:07:55 UTC (rev 13745)
@@ -126,6 +126,7 @@
                 new UrlIndex(mainDbConn),
                 new InstrumentIndex(mainDbConn),
                 new SeriesIndex(mainDbConn),
+                new EditorIndex(mainDbConn),
                 new TagIndex(mainDbConn),
                 new CDStubIndex(mainDbConn), //Note different db
         };

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/IndexOptions.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/IndexOptions.java 2014-04-28 12:27:12 UTC (rev 13744)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/IndexOptions.java 2014-04-28 14:07:55 UTC (rev 13745)
@@ -68,8 +68,8 @@
     public String getFreeDBDump() { return freeDBDump; }
 
     // Selection of indexes to build
-    @Option(name="--indexes", usage="A comma-separated list of indexes to build (annotation,area,artist,instrument,label,place,releasegroup,release,recording,series,work,tag,url,cdstub,freedb)")
-    private String indexes = "annotation,area,artist,instrument,label,place,release,recording,releasegroup,series,work,tag,url,cdstub,freedb";
+    @Option(name="--indexes", usage="A comma-separated list of indexes to build (annotation,area,artist,editor,instrument,label,place,releasegroup,release,recording,series,work,tag,url,cdstub,freedb)")
+    private String indexes = "annotation,area,artist,editor,instrument,label,place,release,recording,releasegroup,series,work,tag,url,cdstub,freedb";
     public ArrayList<String> selectedIndexes() { return new ArrayList<String>(Arrays.asList(indexes.split(","))); }
     public boolean buildIndex(String indexName) { return selectedIndexes().contains(indexName); }
 

Modified: search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AbstractIndexTest.java
===================================================================
--- search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AbstractIndexTest.java 2014-04-28 12:27:12 UTC (rev 13744)
+++ search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AbstractIndexTest.java 2014-04-28 14:07:55 UTC (rev 13745)
@@ -133,14 +133,13 @@
                 stmt.addBatch("DROP TABLE gender");
                 stmt.addBatch("DROP TABLE artist_tag");
                 stmt.addBatch("DROP TABLE artist_ipi");
-
+                stmt.addBatch("DROP TABLE editor");
                 stmt.addBatch("DROP TABLE label");
                 stmt.addBatch("DROP TABLE label_alias");
                 stmt.addBatch("DROP TABLE label_alias_type");
                 stmt.addBatch("DROP TABLE label_type");
                 stmt.addBatch("DROP TABLE label_tag");
                 stmt.addBatch("DROP TABLE label_ipi");
-
                 stmt.addBatch("DROP TABLE release");
                 stmt.addBatch("DROP TABLE release_meta");
                 stmt.addBatch("DROP TABLE release_status");
@@ -265,6 +264,7 @@
             setupUrlTables(stmt);
             setupInstrumentTables(stmt);
             setupSeriesTables(stmt);
+            setupEditorTables(stmt);
             setupReplicationTables(stmt);
             
             insertReferenceData(stmt);
@@ -1215,6 +1215,31 @@
 
     }
 
+    protected void setupEditorTables(Statement stmt) throws Exception {
+        stmt.addBatch("CREATE TABLE editor\n" +
+                "(\n" +
+                "    id                  SERIAL,\n" +
+                "    name                VARCHAR(64) NOT NULL,\n" +
+                "    password            VARCHAR(64),\n" +
+                "    privs               INTEGER ,\n" +
+                "    email               VARCHAR(64) ,\n" +
+                "    website             VARCHAR(255) ,\n" +
+                "    bio                 TEXT,\n" +
+                "    member_since        TIMESTAMP,\n" +
+                "    email_confirm_date  TIMESTAMP,\n" +
+                "    last_login_date     TIMESTAMP,\n" +
+                "    edits_accepted      INTEGER DEFAULT 0,\n" +
+                "    edits_rejected      INTEGER DEFAULT 0,\n" +
+                "    auto_edits_accepted INTEGER DEFAULT 0,\n" +
+                "    edits_failed        INTEGER DEFAULT 0,\n" +
+                "    last_updated        TIMESTAMP,\n" +
+                "    birth_date          DATE,\n" +
+                "    gender              INTEGER,\n" +
+                "    area                INTEGER\n" +
+                ");\n");
+
+    }
+
     protected void setupUrlTables(Statement stmt) throws Exception {
 
         stmt.addBatch("CREATE TABLE url" +


_______________________________________________
MusicBrainz-commits mailing list
[hidden email]
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-commits