Commit f29d12b3 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

extended kwic hit elements, closes #11

parent fb94056e
......@@ -2,6 +2,7 @@ xquery version "3.1";
module namespace fsearch="https://sade.textgrid.de/ns/faceted-search";
import module namespace config="https://sade.textgrid.de/ns/config" at "config.xqm";
import module namespace console="http://exist-db.org/xquery/console";
import module namespace kwic="http://exist-db.org/xquery/kwic";
declare namespace bol="http://blumenbach-online.de/blumenbachiana";
......@@ -145,7 +146,10 @@ declare function fsearch:result-kwic($node as node(), $model as map(*)) {
for $i in 1 to xs:integer(config:get("kwic-hits", "faceted-search"))
return
if(($expanded//exist:match)[$i]) then
kwic:get-summary($expanded, ($expanded//exist:match)[$i], <config width="{$kwic-width}"/>)
let $summary := kwic:get-summary($expanded, ($expanded//exist:match)[$i], <config width="{$kwic-width}"/>),
$console := console:log($summary)
return
<p class="kwic"><span class="kwic-prev">{$summary/span[@class="previous"]/node()}</span> <span class="kwic-hit">{$summary/span[@class="hi"]/node()}</span> <span>{$summary/span[@class="following"]/node()}</span></p>
else ()
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment