@@ -136,7 +136,17 @@ declare function app:display-nodes($node as node(), $model as map(*), $paths as
136136 for $p in $paths
137137 return util:eval (concat ('$record/' ,$p))
138138 else $record/descendant::tei:text
139- let $doc := if (count ($works) gt 0 and count ($works) lt 20 ) then
139+ (: The original conditions capped display at lt 20 related records, silently hiding
140+ the Works collapsible for prolific authors (e.g. person 9 has 34 works) and the
141+ Attestations collapsible for well-attested works. The upper bound has been removed
142+ so all related records are shown regardless of count. The DB query already runs
143+ unconditionally before this point, so removing the cap adds no query overhead —
144+ only XSLT processing and response size scale with count, both negligible at current
145+ data scale. If performance becomes a concern with very large counts, the preferred
146+ fix is to pass a lightweight URI+title structure instead of full TEI documents.
147+ See README-works-mss-limit.md for full analysis. :)
148+ (: let $doc := if(count($works) gt 0 and count($works) lt 20) then :)
149+ let $doc := if (count ($works) gt 0 ) then
140150 <result>
141151 <record>{$record}</record>
142152 <works>
@@ -147,7 +157,8 @@ declare function app:display-nodes($node as node(), $model as map(*), $paths as
147157 }
148158 </works>
149159 </result>
150- else if (count ($mss) gt 0 and count ($mss) lt 20 ) then
160+ (: else if(count($mss) gt 0 and count($mss) lt 20) then :)
161+ else if (count ($mss) gt 0 ) then
151162 <result>
152163 <record>{$record}</record>
153164 <mss>
0 commit comments