Skip to content

Commit 28b9a39

Browse files
committed
SEARCH-680: Index genre annotations
1 parent dff0a11 commit 28b9a39

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

sir/schema/__init__.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,24 @@
4040
SearchAnnotation = E(modelext.CustomAnnotation, [
4141
F("id", "id"),
4242
F("entity", ["areas.area.gid", "artists.artist.gid", "events.event.gid",
43-
"instruments.instrument.gid", "labels.label.gid",
44-
"places.place.gid", "recordings.recording.gid",
45-
"releases.release.gid", "release_groups.release_group.gid",
43+
"genres.genre.gid", "instruments.instrument.gid",
44+
"labels.label.gid", "places.place.gid",
45+
"recordings.recording.gid", "releases.release.gid",
46+
"release_groups.release_group.gid",
4647
"series.series.gid", "works.work.gid"]),
4748
F("name", ["areas.area.name", "artists.artist.name", "events.event.name",
48-
"instruments.instrument.name", "labels.label.name",
49-
"places.place.name", "recordings.recording.name",
50-
"releases.release.name", "release_groups.release_group.name",
49+
"genres.genre.name", "instruments.instrument.name",
50+
"labels.label.name", "places.place.name",
51+
"recordings.recording.name", "releases.release.name",
52+
"release_groups.release_group.name",
5153
"series.series.name", "works.work.name"]),
5254
F("text", "text"),
5355
F("type", ["areas.__tablename__", "artists.__tablename__",
54-
"events.__tablename__", "instruments.__tablename__",
55-
"labels.__tablename__", "places.__tablename__",
56-
"recordings.__tablename__", "releases.__tablename__",
57-
"release_groups.__tablename__", "series.__tablename__",
58-
"works.__tablename__"],
56+
"events.__tablename__", "genres.__tablename__",
57+
"instruments.__tablename__", "labels.__tablename__",
58+
"places.__tablename__", "recordings.__tablename__",
59+
"releases.__tablename__", "release_groups.__tablename__",
60+
"series.__tablename__", "works.__tablename__"],
5961
transformfunc=tfs.annotation_type)
6062
],
6163
1.5,

sir/schema/transformfuncs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"area_annotation": "area",
88
"artist_annotation": "artist",
99
"event_annotation": "event",
10+
"genre_annotation": "genre",
1011
"instrument_annotation": "instrument",
1112
"label_annotation": "label",
1213
"place_annotation": "place",

sir/wscompat/convert.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ def convert_annotation(obj):
761761
l.append(convert_one_annotation(obj, 'artist', a.artist))
762762
for a in obj.events:
763763
l.append(convert_one_annotation(obj, 'event', a.event))
764+
for a in obj.genres:
765+
l.append(convert_one_annotation(obj, 'genre', a.genre))
764766
for a in obj.instruments:
765767
l.append(convert_one_annotation(obj, 'instrument', a.instrument))
766768
for a in obj.labels:

0 commit comments

Comments
 (0)