forked from abaevdict/abaev-basex
improved search highlight and fix search
This commit is contained in:
parent
3855cf6bf0
commit
10b0f39199
3 changed files with 10 additions and 7 deletions
|
@ -269,11 +269,13 @@ declare function abv-m:entry-form-by-id($id as xs:string) {
|
|||
doc(`abaevdict_index/lookup.xml`)/tei:table[1]/tei:entry[@xml:id=$id]/text()
|
||||
};
|
||||
|
||||
declare function abv-m:mark-element($doc as document-node(), $path as xs:string) {
|
||||
declare function abv-m:mark-element($doc as document-node(),
|
||||
$path as xs:string,
|
||||
$query as xs:string) {
|
||||
let $doc-tr := $doc transform with {
|
||||
for $n in xquery:eval($path, {'': .})
|
||||
return replace node $n
|
||||
with <abv:mark>{$n}</abv:mark>
|
||||
with ft:mark($n[. contains text {$query}])
|
||||
}
|
||||
return $doc-tr
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue