Skip to content

Commit

Permalink
Indexing script change: Do not build summaries for stub records
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-morrison committed Aug 19, 2021
1 parent 7f5a5d9 commit 90e88bc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions processing/manuscripts.xquery
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
}
</add>
</add>

0 comments on commit 90e88bc

Please sign in to comment.