Skip to content

Commit

Permalink
fix(index) allow for multiple values in hierarchical genre facet
Browse files Browse the repository at this point in the history
  • Loading branch information
tuurma committed Apr 18, 2024
1 parent a16bca8 commit a1ba6f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.xql
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ declare function idx:get-metadata($root as element(), $field as xs:string) {
};

declare function idx:get-genre($header as element()?) {
for $target in $header//tei:textClass/tei:catRef[@scheme="#genre"]/@target
let $category := id(substring($target, 2), doc($idx:app-root || "/data/taxonomy.xml"))
let $targets := $header//tei:textClass/tei:catRef[@scheme="#genre"]/@target
return
array:for-each(array {$targets}, function($target) {
let $category := id(substring($target, 2), doc($idx:app-root || "/data/taxonomy.xml"))
return
$category/ancestor-or-self::tei:category[parent::tei:category]/tei:catDesc
})
};

declare function idx:get-classification($header as element()?, $scheme as xs:string) {
Expand Down

0 comments on commit a1ba6f9

Please sign in to comment.