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

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

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

root-9
Author: ijabz
Date: 2014-04-24 12:58:33 +0000 (Thu, 24 Apr 2014)
New Revision: 13733

Modified:
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/AreaIndex.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ArtistIndex.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/CommonTables.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/LabelIndex.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/PlaceIndex.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/RecordingIndex.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ReleaseEventHelper.java
   search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ReleaseIndex.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AbstractIndexTest.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AreaIndexTest.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/ArtistIndexTest.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/LabelIndexTest.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/PlaceIndexTest.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/RecordingIndexTest.java
   search_server/trunk/index/src/test/java/org/musicbrainz/search/index/ReleaseIndexTest.java
   search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindAreaTest.java
   search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindRecordingTest.java
   search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindReleaseTest.java
Log:
SEARCH-356:Area Sortname field removed from Database now we just use are name everywhere we output an area sortname

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/AreaIndex.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/AreaIndex.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/AreaIndex.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -85,7 +85,7 @@
 
 
         addPreparedStatement("AREA",
-                        "SELECT a.id, a.gid, a.name, a.sort_name, a.comment as comment, at.name as type, " +
+                        "SELECT a.id, a.gid, a.name, a.comment as comment, at.name as type, " +
                         "   begin_date_year, begin_date_month, begin_date_day, " +
                         "  end_date_year, end_date_month, end_date_day, ended" +
                         " FROM area a" +
@@ -252,9 +252,8 @@
         doc.addField(AreaIndexField.AREA, name);
         area.setName(name);
 
-        String sortName = rs.getString("sort_name");
-        doc.addField(AreaIndexField.SORTNAME,sortName);
-        area.setSortName(sortName);
+        doc.addField(AreaIndexField.SORTNAME,name);
+        area.setSortName(name);
 
         String comment = rs.getString("comment");
         doc.addFieldOrNoValue(AreaIndexField.COMMENT, comment);

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ArtistIndex.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ArtistIndex.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ArtistIndex.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -130,9 +130,9 @@
                         "  artist_type.name as type, a.begin_date_year, a.begin_date_month, a.begin_date_day, " +
                         "  a.end_date_year, a.end_date_month, a.end_date_day,a.ended, " +
                         "  a.comment, lower(i.code) as country, lower(gender.name) as gender," +
-                        "  a1.gid as area_gid, a1.name as area_name, a1.sort_name as area_sortname, " +
-                        "  a2.gid as beginarea_gid, a2.name as beginarea_name, a2.sort_name as beginarea_sortname, " +
-                        "  a3.gid as endarea_gid, a3.name as endarea_name, a3.sort_name as endarea_sortname" +
+                        "  a1.gid as area_gid, a1.name as area_name,  " +
+                        "  a2.gid as beginarea_gid, a2.name as beginarea_name,  " +
+                        "  a3.gid as endarea_gid, a3.name as endarea_name" +
                         " FROM artist a " +
                         "  LEFT JOIN artist_type ON a.type = artist_type.id " +
                         "  LEFT JOIN iso_3166_1 i on a.area=i.area" +
@@ -334,8 +334,7 @@
             String areaName = rs.getString("area_name");
             doc.addFieldOrNoValue(ArtistIndexField.AREA, areaName);
             area.setName(areaName);
-            String areaSortName = rs.getString("area_sortname");
-            area.setSortName(areaSortName);
+            area.setSortName(areaName);
             artist.setArea(area);
         }
         else {
@@ -349,7 +348,7 @@
             String areaName = rs.getString("beginarea_name");
             doc.addFieldOrNoValue(ArtistIndexField.BEGIN_AREA, areaName);
             area.setName(areaName);
-            String areaSortName = rs.getString("beginarea_sortname");
+            String areaSortName = rs.getString("beginarea_name");
             area.setSortName(areaSortName);
             artist.setBeginArea(area);
         }
@@ -365,7 +364,7 @@
             String areaName = rs.getString("endarea_name");
             doc.addFieldOrNoValue(ArtistIndexField.END_AREA, areaName);
             area.setName(areaName);
-            String areaSortName = rs.getString("endarea_sortname");
+            String areaSortName = rs.getString("endarea_name");
             area.setSortName(areaSortName);
             artist.setEndArea(area);
         }

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/CommonTables.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/CommonTables.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/CommonTables.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -134,7 +134,7 @@
                 "CREATE TEMPORARY TABLE tmp_release_event AS " +
                         " SELECT r1.release, r2.code as country, " +
                         "  r1.date_year, r1.date_month, r1.date_day," +
-                        "  a1.gid as gid, a1.name as name, a1.sort_name as sort_name" +
+                        "  a1.gid as gid, a1.name as name" +
                         " FROM release_country r1 " +
                         " LEFT JOIN area a1 " +
                         " ON r1.country = a1.id" +
@@ -143,7 +143,7 @@
                         " UNION" +
                         " SELECT release, null as country, " +
                         "  date_year, date_month, date_day," +
-                        "  null as gid, null as name, null as sort_name"+
+                        "  null as gid, null as name"+
                         " FROM release_unknown_country r1 ");
         clock.stop();
         System.out.println("tmp_release_event     :Finished:" + Utils.formatClock(clock));

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/LabelIndex.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/LabelIndex.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/LabelIndex.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -106,7 +106,7 @@
                 "  label_type.name as type, label.begin_date_year, label.begin_date_month, label.begin_date_day, " +
                 "  label.end_date_year, label.end_date_month, label.end_date_day, label.ended," +
                 "  label.comment, label_code, lower(i.code) as country, " +
-                "  a1.gid as area_gid, a1.name as area_name, a1.sort_name as area_sortname " +
+                "  a1.gid as area_gid, a1.name as area_name " +
                 " FROM label " +
                 "  LEFT JOIN label_type ON label.type = label_type.id " +
                 "  LEFT JOIN iso_3166_1 i on label.area=i.area" +
@@ -274,8 +274,7 @@
             String areaName = rs.getString("area_name");
             area.setName(areaName);
             doc.addFieldOrNoValue(ArtistIndexField.AREA, areaName);
-            String areaSortName = rs.getString("area_sortname");
-            area.setSortName(areaSortName);
+            area.setSortName(areaName);
             label.setArea(area);
         }
         else {

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/PlaceIndex.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/PlaceIndex.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/PlaceIndex.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -91,7 +91,7 @@
                         "SELECT p.coordinates, p.id, p.gid, p.name, p.address, pt.name as type, " +
                         "  p.begin_date_year, p.begin_date_month, p.begin_date_day, " +
                         "  p.end_date_year, p.end_date_month, p.end_date_day, p.ended, p.comment, " +
-                        "  a1.gid as area_gid, a1.name as area_name, a1.sort_name as area_sortname " +
+                        "  a1.gid as area_gid, a1.name as area_name " +
                         " FROM place p" +
                         "  LEFT JOIN place_type pt ON p.type = pt.id " +
                         "  LEFT JOIN area a1 on p.area = a1.id" +
@@ -247,8 +247,7 @@
             String areaName = rs.getString("area_name");
             area.setName(areaName);
             doc.addFieldOrNoValue(ArtistIndexField.AREA, areaName);
-            String areaSortName = rs.getString("area_sortname");
-            area.setSortName(areaSortName);
+            area.setSortName(areaName);
             place.setArea(area);
         }
         else {

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/RecordingIndex.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/RecordingIndex.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/RecordingIndex.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -249,7 +249,7 @@
 
         releaseEvents =
                 " SELECT release, country, " +
-                        "   date_year, date_month, date_day, name, sort_name, gid"+
+                        "   date_year, date_month, date_day, name, gid"+
                         " FROM tmp_release_event r " +
                         " WHERE r.release in ";
 
@@ -698,7 +698,7 @@
                 String iso_code=rs.getString("country");
                 String gid       = rs.getString("gid");
                 String name      = rs.getString("name");
-                String sort_name = rs.getString("sort_name");
+                String sort_name = name;
                 if(iso_code!=null) {
                     Iso31661CodeList isoList = of.createIso31661CodeList();
                     isoList.getIso31661Code().add(iso_code);

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ReleaseEventHelper.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ReleaseEventHelper.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ReleaseEventHelper.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -59,7 +59,7 @@
             String iso_code  = rs.getString("country");
             String gid       = rs.getString("gid");
             String name      = rs.getString("name");
-            String sort_name = rs.getString("sort_name");
+            String sort_name = name;
             ReleaseEvent releaseEvent = of.createReleaseEvent();
             if(iso_code!=null) {
                 Iso31661CodeList isoList = of.createIso31661CodeList();

Modified: search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ReleaseIndex.java
===================================================================
--- search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ReleaseIndex.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/main/java/org/musicbrainz/search/index/ReleaseIndex.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -181,7 +181,7 @@
 
         addPreparedStatement("RELEASE_EVENTS",
                 " SELECT release, country, " +
-                "   date_year, date_month, date_day, name, sort_name, gid"+
+                "   date_year, date_month, date_day, name, gid"+
                 " FROM tmp_release_event r1 " +
                 " WHERE release BETWEEN ? AND ? ");
 

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-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AbstractIndexTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -272,7 +272,6 @@
         stmt.addBatch("CREATE TABLE area (id          INTEGER PRIMARY KEY," +
                 "                   gid               uuid," +
                 "                   name              VARCHAR ," +
-                "                   sort_name         VARCHAR ," +
                 "                   comment           VARCHAR ," +
                 "                   type              INTEGER," +
                 "                   edits_pending     INTEGER NOT NULL DEFAULT 0," +

Modified: search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AreaIndexTest.java
===================================================================
--- search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AreaIndexTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/test/java/org/musicbrainz/search/index/AreaIndexTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -37,7 +37,7 @@
     private void addAreaOne() throws Exception {
 
         Statement stmt = conn.createStatement();
-        stmt.addBatch("INSERT INTO area (id, gid,name,sort_name, comment, type, begin_date_year, end_date_year) VALUES (1, 'aa95182f-df0a-3ad6-8bfb-4b63482cd276', 'Afghanistan','Afghanistan','A Country in Asia',1,1830,2020)");
+        stmt.addBatch("INSERT INTO area (id, gid,name, comment, type, begin_date_year, end_date_year) VALUES (1, 'aa95182f-df0a-3ad6-8bfb-4b63482cd276', 'Afghanistan','A Country in Asia',1,1830,2020)");
         stmt.addBatch("INSERT INTO area_type(id, name) VALUES (1, 'Country')");
         stmt.addBatch("INSERT INTO area_alias (id, area, sort_name, name, primary_for_locale, locale, type ) VALUES (3, 1, 'Afghan', 'Afghany', true, 'en',1)");
         stmt.addBatch("INSERT INTO iso_3166_1(area, code) VALUES (1,'AF')");

Modified: search_server/trunk/index/src/test/java/org/musicbrainz/search/index/ArtistIndexTest.java
===================================================================
--- search_server/trunk/index/src/test/java/org/musicbrainz/search/index/ArtistIndexTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/test/java/org/musicbrainz/search/index/ArtistIndexTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -42,9 +42,9 @@
         stmt.addBatch("INSERT INTO artist (id, name, gid, sort_name, begin_date_year, begin_date_month, type, gender, area,begin_area,ended)" +
             " VALUES (521316, 'Farming Incident', '4302e264-1cf0-4d1f-aca7-2a6f89e34b36', 'incident', 1999, 4, 2, 1, 1,38,true)");
         stmt.addBatch("INSERT INTO artist_ipi (artist,ipi) values(521316,'10001')");
-        stmt.addBatch("INSERT INTO area (id, gid, name, sort_name) VALUES (1, '4302e264-1cf0-4d1f-aca7-2a6f89e34b36','Afghanistan','Afghanistan')");
+        stmt.addBatch("INSERT INTO area (id, gid, name) VALUES (1, '4302e264-1cf0-4d1f-aca7-2a6f89e34b36','Afghanistan')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (1, 'AF')");
-        stmt.addBatch("INSERT INTO area (id, gid, name, sort_name) VALUES (38, 'b8caa692-704d-412b-a410-4fbcf5b9c796','Canada','Canada')");
+        stmt.addBatch("INSERT INTO area (id, gid, name) VALUES (38, 'b8caa692-704d-412b-a410-4fbcf5b9c796','Canada')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (38, 'CA')");
         stmt.executeBatch();
         stmt.close();
@@ -119,7 +119,6 @@
             checkTermX(ir, ArtistIndexField.ARTIST, "incident",1);
             checkTerm(ir, ArtistIndexField.ARTIST_ID, "4302e264-1cf0-4d1f-aca7-2a6f89e34b36");
             checkTerm(ir, ArtistIndexField.SORTNAME, "incident");
-//            checkTermX(ir, ArtistIndexField.SORTNAME, "incident", 1);
             checkTerm(ir, ArtistIndexField.BEGIN, "1999-04");
             checkTerm(ir, ArtistIndexField.TYPE, "group");
         }

Modified: search_server/trunk/index/src/test/java/org/musicbrainz/search/index/LabelIndexTest.java
===================================================================
--- search_server/trunk/index/src/test/java/org/musicbrainz/search/index/LabelIndexTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/test/java/org/musicbrainz/search/index/LabelIndexTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -62,7 +62,7 @@
 
         Statement stmt = conn.createStatement();
 
-        stmt.addBatch("INSERT INTO area (id, gid, name, sort_name) VALUES (38, 'b8caa692-704d-412b-a410-4fbcf5b9c796','Canada','Canada')");
+        stmt.addBatch("INSERT INTO area (id, gid, name) VALUES (38, 'b8caa692-704d-412b-a410-4fbcf5b9c796','Canada')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (38, 'CA')");
     stmt.addBatch("INSERT INTO label(id, gid, name, type, label_code, area, comment, " +
  " begin_date_year, begin_date_month, begin_date_day, end_date_year, end_date_month,ended) " +

Modified: search_server/trunk/index/src/test/java/org/musicbrainz/search/index/PlaceIndexTest.java
===================================================================
--- search_server/trunk/index/src/test/java/org/musicbrainz/search/index/PlaceIndexTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/test/java/org/musicbrainz/search/index/PlaceIndexTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -35,7 +35,7 @@
     private void addPlaceOne() throws Exception {
 
         Statement stmt = conn.createStatement();
-        stmt.addBatch("INSERT INTO area (id, gid, name, sort_name) VALUES (38, 'b8caa692-704d-412b-a410-4fbcf5b9c796','County of OxfordShire','Oxfordshire County')");
+        stmt.addBatch("INSERT INTO area (id, gid, name) VALUES (38, 'b8caa692-704d-412b-a410-4fbcf5b9c796','County of OxfordShire')");
         stmt.addBatch("INSERT INTO place (comment,coordinates, id, gid,name,address,type, begin_date_year, end_date_year,area) VALUES ('comment',(180.56,120),1, 'aa95182f-df0a-3ad6-8bfb-4b63482cd276', 'Manor Studios','1 New Street',1,1830,2020,38)");
         stmt.addBatch("INSERT INTO place_type(id, name) VALUES (1, 'Studio')");
         stmt.addBatch("INSERT INTO place_alias (id, place, name, sort_name, primary_for_locale, locale, type ) VALUES (3, 1, 'Manox','Manoy', true, 'en',1)");
@@ -238,7 +238,7 @@
             assertNotNull(area);
             assertEquals("b8caa692-704d-412b-a410-4fbcf5b9c796", area.getId());
             assertEquals("County of OxfordShire", area.getName());
-            assertEquals("Oxfordshire County", area.getSortName());
+            assertEquals("County of OxfordShire", area.getSortName());
 
 
 

Modified: search_server/trunk/index/src/test/java/org/musicbrainz/search/index/RecordingIndexTest.java
===================================================================
--- search_server/trunk/index/src/test/java/org/musicbrainz/search/index/RecordingIndexTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/test/java/org/musicbrainz/search/index/RecordingIndexTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -62,15 +62,15 @@
                 " VALUES (491240, 'c3b8dbc9-c1ff-4743-9015-8d762819134e', 'Crocodiles (bonus disc)', 3, 491240, 1, 1, 1, 1)");
 
         stmt.addBatch("INSERT INTO release_country (release, country, date_year, date_month, date_day) values (491240, 221, 1970,1,1)");
-        stmt.addBatch("INSERT INTO area (id, gid, name, sort_name) VALUES (221, 'c3b8dbc9-c1ff-4743-9015-8d762819134g','United Kingdom','Kingdom of UK')");
+        stmt.addBatch("INSERT INTO area (id, gid, name) VALUES (221, 'c3b8dbc9-c1ff-4743-9015-8d762819134g','United Kingdom')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (221, 'GB')");
 
         stmt.addBatch("INSERT INTO release_country (release, country) values (491240, 222)");
-        stmt.addBatch("INSERT INTO area (id, gid, name, sort_name) VALUES (222, 'c3b8dbc9-c1ff-4743-9015-8d762819134e','Abania','Albania')");
+        stmt.addBatch("INSERT INTO area (id, gid, name) VALUES (222, 'c3b8dbc9-c1ff-4743-9015-8d762819134e','Abania')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (222, 'AF')");
 
         stmt.addBatch("INSERT INTO release_country (release, country) values (491240, 2)");
-        stmt.addBatch("INSERT INTO area (id, gid,name, sort_name) VALUES (2,  'c3b8dbc9-c1ff-4743-9015-8d762819134f','Afghanistan','Afghanistan')");
+        stmt.addBatch("INSERT INTO area (id, gid,name) VALUES (2,  'c3b8dbc9-c1ff-4743-9015-8d762819134f','Afghanistan')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (2, 'AN')");
 
         stmt.addBatch("INSERT INTO release_unknown_country (release, date_year) values (491240, 1950)");
@@ -919,13 +919,13 @@
             assertEquals("1970-01-01", rel.getReleaseEvent().get(1).getDate());
             assertEquals("c3b8dbc9-c1ff-4743-0901-58d762819134", rel.getReleaseEvent().get(1).getArea().getId());
             assertEquals("United Kingdom", rel.getReleaseEvent().get(1).getArea().getName());
-            assertEquals("Kingdom of UK", rel.getReleaseEvent().get(1).getArea().getSortName());
+            assertEquals("United Kingdom", rel.getReleaseEvent().get(1).getArea().getSortName());
 
             assertEquals("AF", rel.getReleaseEvent().get(2).getArea().getIso31661CodeList().getIso31661Code().get(0));
             assertEquals(null, rel.getReleaseEvent().get(2).getDate());
             assertEquals("c3b8dbc9-c1ff-4743-9015-8d762819134e", rel.getReleaseEvent().get(2).getArea().getId());
             assertEquals("Abania", rel.getReleaseEvent().get(2).getArea().getName());
-            assertEquals("Albania", rel.getReleaseEvent().get(2).getArea().getSortName());
+            assertEquals("Abania", rel.getReleaseEvent().get(2).getArea().getSortName());
 
             assertEquals("AN", rel.getReleaseEvent().get(3).getArea().getIso31661CodeList().getIso31661Code().get(0));
             assertEquals(null, rel.getReleaseEvent().get(3).getDate());

Modified: search_server/trunk/index/src/test/java/org/musicbrainz/search/index/ReleaseIndexTest.java
===================================================================
--- search_server/trunk/index/src/test/java/org/musicbrainz/search/index/ReleaseIndexTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/index/src/test/java/org/musicbrainz/search/index/ReleaseIndexTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -126,15 +126,15 @@
                 " VALUES (491240, 'c3b8dbc9-c1ff-4743-9015-8d762819134e', 'Crocodiles (bonus disc)', 1, 491240, 1, 1, 1, 'demo')");
 
         stmt.addBatch("INSERT INTO release_country (release, country, date_year, date_month, date_day) values (491240, 221, 1970,1,1)");
-        stmt.addBatch("INSERT INTO area (id, gid, name, sort_name) VALUES (221, 'c3b8dbc9-c1ff-4743-9015-8d762819134g','United Kingdom','Kingdom of UK')");
+        stmt.addBatch("INSERT INTO area (id, gid, name) VALUES (221, 'c3b8dbc9-c1ff-4743-9015-8d762819134g','United Kingdom')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (221, 'GB')");
 
         stmt.addBatch("INSERT INTO release_country (release, country) values (491240, 222)");
-        stmt.addBatch("INSERT INTO area (id, gid, name, sort_name) VALUES (222, 'c3b8dbc9-c1ff-4743-9015-8d762819134e','Abania','Albania')");
+        stmt.addBatch("INSERT INTO area (id, gid, name) VALUES (222, 'c3b8dbc9-c1ff-4743-9015-8d762819134e','Abania')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (222, 'AF')");
 
         stmt.addBatch("INSERT INTO release_country (release, country) values (491240, 2)");
-        stmt.addBatch("INSERT INTO area (id, gid,name, sort_name) VALUES (2,  'c3b8dbc9-c1ff-4743-9015-8d762819134f','Afghanistan','Afghanistan')");
+        stmt.addBatch("INSERT INTO area (id, gid,name) VALUES (2,  'c3b8dbc9-c1ff-4743-9015-8d762819134f','Afghanistan')");
         stmt.addBatch("INSERT INTO iso_3166_1 (area, code) VALUES (2, 'AN')");
 
         stmt.addBatch("INSERT INTO release_unknown_country (release, date_year) values (491240, 1950)");
@@ -903,14 +903,14 @@
             assertEquals("1970-01-01", rel.getReleaseEvent().get(1).getDate());
             assertEquals("c3b8dbc9-c1ff-4743-0901-58d762819134", rel.getReleaseEvent().get(1).getArea().getId());
             assertEquals("United Kingdom", rel.getReleaseEvent().get(1).getArea().getName());
-            assertEquals("Kingdom of UK", rel.getReleaseEvent().get(1).getArea().getSortName());
+            assertEquals("United Kingdom", rel.getReleaseEvent().get(1).getArea().getSortName());
 
 
             assertEquals("AF", rel.getReleaseEvent().get(2).getArea().getIso31661CodeList().getIso31661Code().get(0));
             assertEquals(null, rel.getReleaseEvent().get(2).getDate());
             assertEquals("c3b8dbc9-c1ff-4743-9015-8d762819134e", rel.getReleaseEvent().get(2).getArea().getId());
             assertEquals("Abania", rel.getReleaseEvent().get(2).getArea().getName());
-            assertEquals("Albania", rel.getReleaseEvent().get(2).getArea().getSortName());
+            assertEquals("Abania", rel.getReleaseEvent().get(2).getArea().getSortName());
 
             assertEquals("AN", rel.getReleaseEvent().get(3).getArea().getIso31661CodeList().getIso31661Code().get(0));
             assertEquals(null, rel.getReleaseEvent().get(3).getDate());

Modified: search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindAreaTest.java
===================================================================
--- search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindAreaTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindAreaTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -154,6 +154,7 @@
     }
 
     @Test
+    //Always the same as name
     public void testFindAreaBySortName() throws Exception {
         Results res = ss.search("sortname:\"Afghanistan\"", 0, 10);
         assertEquals(1, res.getTotalHits());

Modified: search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindRecordingTest.java
===================================================================
--- search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindRecordingTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindRecordingTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -151,7 +151,7 @@
             areaInner.setIso31661CodeList(isoList);
             areaInner.setId("1fa8aa07-c688-1f7c-734b-4d82e528b09b");
             areaInner.setName("United Kingdom");
-            areaInner.setSortName("Kingdom of United");
+            areaInner.setSortName("United Kingdom");
             re.setArea(areaInner);
             re.setDate("1970-01-01");
             rel.getReleaseEvent().add(re);
@@ -544,7 +544,7 @@
         assertTrue(output.contains("<track id=\"c3b8dbc9-c1ff-4743-9015-8d762819134e\"><number>A4</number><title>Gravitational Lens</title><length>233000</length><artist-credit><name-credit><artist id=\"2302e264-1cf0-4d1f-aca7-2a6f89e34b36\"><name>Pig Incident</name><sort-name>Incident, Pig</sort-name></artist></name-credit></artist-credit></track>"));
         assertTrue(output.contains("<area id=\"1fa8aa07-c688-1f7c-734b-4d82e528b09b\">"));
         assertTrue(output.contains("<name>United Kingdom</name>"));
-        assertTrue(output.contains("<sort-name>Kingdom of United</sort-name>"));
+        assertTrue(output.contains("<sort-name>United Kingdom</sort-name>"));
         assertTrue(output.contains("<iso-3166-1-code-list><iso-3166-1-code>UK</iso-3166-1-code></iso-3166-1-code-list>"));
         assertTrue(output.contains("<video>true</video>"));
     }
@@ -583,7 +583,7 @@
         assertTrue(output.contains("\"release-event-list\":{\"release-event\":[{\"date\":\"1970-01-01\""));
         assertTrue(output.contains("\"id\":\"1fa8aa07-c688-1f7c-734b-4d82e528b09b\","));
         assertTrue(output.contains("\"name\":\"United Kingdom\","));
-        assertTrue(output.contains("\"sort-name\":\"Kingdom of United\","));
+        assertTrue(output.contains("\"sort-name\":\"United Kingdom\","));
         assertTrue(output.contains("\"iso-3166-1-code-list\":{\"iso-3166-1-code\":[\"UK\"]}"));
         assertTrue(output.contains("\"video\":\"true\""));
     }
@@ -624,7 +624,7 @@
         assertTrue(output.contains("{\"id\":\"c3b8dbc9-c1ff-4743-9015-8d762819134e\""));
         assertTrue(output.contains("\"id\":\"1fa8aa07-c688-1f7c-734b-4d82e528b09b\","));
         assertTrue(output.contains("\"name\":\"United Kingdom\","));
-        assertTrue(output.contains("\"sort-name\":\"Kingdom of United\","));
+        assertTrue(output.contains("\"sort-name\":\"United Kingdom\","));
         assertTrue(output.contains("\"iso-3166-1-codes\":[\"UK\"]"));
         assertTrue(output.contains("\"video\":true"));
     }

Modified: search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindReleaseTest.java
===================================================================
--- search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindReleaseTest.java 2014-04-24 12:13:28 UTC (rev 13732)
+++ search_server/trunk/servlet/src/test/java/org/musicbrainz/search/servlet/FindReleaseTest.java 2014-04-24 12:58:33 UTC (rev 13733)
@@ -167,7 +167,7 @@
             areaInner.setIso31661CodeList(isoList);
             areaInner.setId("1fa8aa07-c688-1f7c-734b-4d82e528b09b");
             areaInner.setName("United Kingdom");
-            areaInner.setSortName("Kingdom of United");
+            areaInner.setSortName("United Kingdom");
             re.setDate("2005");
             re.setArea(areaInner);
             rel.getReleaseEvent().add(re);
@@ -789,7 +789,7 @@
         assertTrue(output.contains("<country>GB</country>"));
         assertTrue(output.contains("<area id=\"1fa8aa07-c688-1f7c-734b-4d82e528b09b\">"));
         assertTrue(output.contains("<name>United Kingdom</name>"));
-        assertTrue(output.contains("<sort-name>Kingdom of United</sort-name>"));
+        assertTrue(output.contains("<sort-name>United Kingdom</sort-name>"));
         assertTrue(output.contains("<format>Vinyl</format>"));
         assertTrue(output.contains("<asin>B00004Y6O9</asin>"));
         assertTrue(output.contains("<track-count>17</track-count>"));
@@ -830,7 +830,7 @@
         assertTrue(output.contains("\"secondary-type-list\":{\"secondary-type\":[\"Live\",\"Compilation\"]}}"));
         assertTrue(output.contains("{\"release-event\":[{\"date\":\"2005\""));
         assertTrue(output.contains("\"name\":\"United Kingdom\","));
-        assertTrue(output.contains("\"sort-name\":\"Kingdom of United\","));
+        assertTrue(output.contains("\"sort-name\":\"United Kingdom\","));
         assertTrue(output.contains("\"id\":\"1fa8aa07-c688-1f7c-734b-4d82e528b09b\","));
     }
 
@@ -867,7 +867,7 @@
         assertTrue(output.contains("\"release-events\":[{\"date\":\"2005\""));
         assertTrue(output.contains("\"secondary-types\":[\"Live\",\"Compilation\"]}"));
         assertTrue(output.contains("\"name\":\"United Kingdom\","));
-        assertTrue(output.contains("\"sort-name\":\"Kingdom of United\","));
+        assertTrue(output.contains("\"sort-name\":\"United Kingdom\","));
         assertTrue(output.contains("\"id\":\"1fa8aa07-c688-1f7c-734b-4d82e528b09b\","));
 
     }


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