Commit 17b41f9a authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

search awere of config namespace

parent cc3d04c8
......@@ -57,23 +57,23 @@
<param key="hits-per-page">10</param>
<param key="result-xslt">search-hits.xslt</param>
<param key="query-root">
<xpath xmlns="">//tei:TEI</xpath>
<xpath>//tei:TEI</xpath>
</param>
<param key="result-title">
<xpath xmlns="">//tei:fileDesc//tei:titleStmt/tei:title/text()</xpath>
<xpath>//tei:fileDesc//tei:titleStmt/tei:title/text()</xpath>
</param>
<param key="thumbnail">false</param>
<param key="facets">
<facet xmlns="" key="persons" title="Person">
<facet key="persons" title="Person">
<xpath>tei:author</xpath>
</facet>
<facet xmlns="" key="keywords" title="Schlagwort">
<facet key="keywords" title="Schlagwort">
<xpath>tei:term</xpath>
</facet>
<facet xmlns="" key="dates" title="Zeit">
<facet key="dates" title="Zeit">
<xpath>tei:date/@when</xpath>
</facet>
<facet xmlns="" key="places" title="Publikationsort">
<facet key="places" title="Publikationsort">
<xpath>tei:pubPlace</xpath>
</facet>
</param>
......
......@@ -90,7 +90,7 @@ declare function fsearch:result-title($node as node(), $model as map(*)) {
return
<a href="{$viewdoc}{util:document-name($model("hit"))}">
{
for $titleQuery in config:get("result-title", "faceted-search")//xpath
for $titleQuery in config:get("result-title", "faceted-search")//cf:xpath
return util:eval("($model('hit')" || $titleQuery || ")[1]")
}
</a>
......@@ -167,9 +167,9 @@ function fsearch:result-id($node as node(), $model as map(*)) {
declare function fsearch:facets($model as map(*), $hits) as map() {
map:new(
for $facet in config:get("facets", "faceted-search")//facet
for $facet in config:get("facets", "faceted-search")//cf:facet
return
map:entry(xs:string($facet/@key), local:facet($model, $hits, $facet/@key, $facet//xpath/text()))
map:entry(xs:string($facet/@key), local:facet($model, $hits, $facet/@key, $facet//cf:xpath/text()))
)
};
......@@ -183,7 +183,7 @@ function fsearch:facet-title($node as node(), $model as map(*)) {
};
declare function fsearch:facet($node as node(), $model as map(*)) as item()* {
let $facets := config:get("facets", "faceted-search")//facet
let $facets := config:get("facets", "faceted-search")//cf:facet
for $facet in $facets
(: hide facet-categories with less than one entry :)
......@@ -303,7 +303,7 @@ declare function local:construct-facet-query($model as map(*)) as xs:string {
for $fquery in tokenize($facet, ",")
let $parts := tokenize($fquery, ":")
let $select :=
for $xpath in config:get("facets", "faceted-search")//facet[@key = $parts[1]]//xpath
for $xpath in config:get("facets", "faceted-search")//cf:facet[@key = $parts[1]]//cf:xpath
let $val := xmldb:decode($parts[2])
let $op := if(starts-with($val, "!"))
......
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