From 90e88bcaee33f84c53bf209c874354da8ce103e6 Mon Sep 17 00:00:00 2001 From: Andrew Morrison Date: Thu, 19 Aug 2021 17:44:10 +0100 Subject: [PATCH] Indexing script change: Do not build summaries for stub records --- processing/manuscripts.xquery | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/processing/manuscripts.xquery b/processing/manuscripts.xquery index 56a62ab09c..c852ab5fbc 100644 --- a/processing/manuscripts.xquery +++ b/processing/manuscripts.xquery @@ -39,9 +39,14 @@ declare function local:workSubjects($workkeyatts as attribute()*, $solrfield as declare function local:buildSummaries($ms as document-node()) as xs:string* { - if ($ms//tei:msDesc/(tei:head|tei:history/tei:origin|tei:msContents/tei:summary) or not($ms//tei:msPart/(tei:head|tei:history/tei:origin|tei:msContents/tei:summary))) then + if ($ms/tei:TEI/@type = 'stub') then + (: No summaries for stub records :) + () + else if ($ms//tei:msDesc/(tei:head|tei:history/tei:origin|tei:msContents/tei:summary) or not($ms//tei:msPart/(tei:head|tei:history/tei:origin|tei:msContents/tei:summary))) then + (: For manuscripts without parts, or composite manuscripts with an overall head/summary/origin, index with a single summary :) local:buildSummary($ms//tei:msDesc[1]) else + (: For composite manuscripts, index a summary for each part (but only up to the first 15 parts) :) ( for $part in $ms//tei:msPart[count(preceding::tei:msPart) lt 10] return @@ -172,4 +177,4 @@ declare function local:buildSummary($msdescorpart as element()) as xs:string else bod:logging('warn', 'Cannot process manuscript without @xml:id for root TEI element', base-uri($ms)) } - \ No newline at end of file +