in experiments/create-search-index/src/Services/NGAOpenDataRetriever.cs [38:61]
left join (
select objectID, termtype, string_agg(term::text, ', ') as keywords from objects_terms
group by objectID, termtype) ot_keyword on o.objectID = ot_keyword.objectID and ot_keyword.termtype = 'Keyword'
left join (
select objectID, termtype, string_agg(term::text, ', ') as places from objects_terms
group by objectID, termtype) ot_place on o.objectID = ot_place.objectID and ot_place.termtype = 'Place Executed'
left join (
select objectID, termtype, string_agg(term::text, ', ') as schools from objects_terms
group by objectID, termtype) ot_school on o.objectID = ot_school.objectID and ot_school.termtype = 'School'
left join (
select objectID, termtype, string_agg(term::text, ', ') as styles from objects_terms
group by objectID, termtype) ot_style on o.objectID = ot_style.objectID and ot_style.termtype = 'Style'
left join (
select objectID, termtype, string_agg(term::text, ', ') as techniques from objects_terms
group by objectID, termtype) ot_technique on o.objectID = ot_technique.objectID and ot_technique.termtype = 'Technique'
left join (
select objectID, termtype, string_agg(term::text, ', ') as themes from objects_terms
group by objectID, termtype) ot_theme on o.objectID = ot_theme.objectID and ot_theme.termtype = 'Theme'
where pi.iiifURL <> ''";
if (base._recordLimit > 0)
{
command += $" limit {base._recordLimit};";
}