From a3ba6defb7c217756f80c22100e5c203c90b9407 Mon Sep 17 00:00:00 2001 From: Adrian Rudnik Date: Wed, 1 Nov 2023 10:53:20 +0100 Subject: [PATCH] Added xml /Ableton/LiveSet/Annotation mapping --- service/internal/indexer/mapping_live_set.go | 2 ++ service/internal/parser/ablv5parser/parse_live_set.go | 1 + service/internal/parser/ablv5schema/xml.go | 1 + 3 files changed, 4 insertions(+) diff --git a/service/internal/indexer/mapping_live_set.go b/service/internal/indexer/mapping_live_set.go index 0134a03d..4aac0d84 100644 --- a/service/internal/indexer/mapping_live_set.go +++ b/service/internal/indexer/mapping_live_set.go @@ -18,6 +18,7 @@ type LiveSetDocument struct { MinorVersion string `json:"minorVersion,omitempty"` Creator string `json:"creator,omitempty"` Revision string `json:"revision,omitempty"` + Annotation string `json:"annotation,omitempty"` Scale string `json:"scale,omitempty"` ScaleName string `json:"scaleName,omitempty"` @@ -58,6 +59,7 @@ func buildLiveSetMapping() *mapping.DocumentMapping { m.AddFieldMappingsAt("minorVersion", NewPayloadFieldMapping()) m.AddFieldMappingsAt("creator", mapping.NewKeywordFieldMapping()) m.AddFieldMappingsAt("revision", NewPayloadFieldMapping()) + m.AddFieldMappingsAt("annotation", NewFulltextTextFieldMapping(true)) m.AddFieldMappingsAt("scale", mapping.NewKeywordFieldMapping()) m.AddFieldMappingsAt("scaleName", mapping.NewKeywordFieldMapping()) diff --git a/service/internal/parser/ablv5parser/parse_live_set.go b/service/internal/parser/ablv5parser/parse_live_set.go index a5b6bf7e..baf58b9b 100644 --- a/service/internal/parser/ablv5parser/parse_live_set.go +++ b/service/internal/parser/ablv5parser/parse_live_set.go @@ -155,6 +155,7 @@ func ParseLiveSet(m *stats.Metrics, path string, data *ablv5schema.Ableton) *pip liveSet.MinorVersion = data.MinorVersion liveSet.Creator = data.Creator liveSet.Revision = data.Revision + liveSet.Annotation = data.LiveSet.Annotation.Value liveSet.ScaleRootNote = data.LiveSet.ScaleInformation.HumanizeRootNote() liveSet.ScaleName = data.LiveSet.ScaleInformation.Name.Value diff --git a/service/internal/parser/ablv5schema/xml.go b/service/internal/parser/ablv5schema/xml.go index 46134dd2..e2d277de 100644 --- a/service/internal/parser/ablv5schema/xml.go +++ b/service/internal/parser/ablv5schema/xml.go @@ -22,6 +22,7 @@ type LiveSet struct { ScaleInformation ScaleInformation `xml:"ScaleInformation"` InKey BooleanValue `xml:"InKey"` MasterTrack MasterTrack `xml:"MasterTrack"` + Annotation StringValue `xml:"Annotation"` } type Tracks struct {