XQuery Function Documentation

Search and Browse

shakes:create-query

shakes:create-query($queryStr as xs:string?, $mode as xs:string?) as item()*

Helper function: create a lucene query from the user input

Parameters:
$queryStr? $queryStr?
$mode? $mode?
Returns:
item()*

shakes:do-query

shakes:do-query($queryStr as xs:string?, $mode as xs:string?) as item()*

Parameters:
$queryStr? $queryStr?
$mode? $mode?
Returns:
item()*

shakes:from-session

shakes:from-session($node as node()*, $model as map(*)) as item()*

Read the last query result from the HTTP session and pass it to nested templates in the $model parameter.

Parameters:
$node* $node*
$model $model
Returns:
item()*

shakes:hit-count

shakes:hit-count($node as node()*, $model as map(*)) as item()*

Create a span with the number of items in the current search result. The annotation %templates:output("wrap") tells the templating module to create a new element with the same name and attributes as $node, using the return value of the function as its content.

Parameters:
$node* $node*
$model $model
Returns:
item()*

shakes:query

shakes:query($node as node()*, $model as map(*), $query as xs:string?, $mode as xs:string?) as item()*

Execute a query and pass the result to nested template functions. This function returns a map, not a node. The templating module recognizes this and will merge the map into the current model, then continue processing any children of $node.
The annotation %templates:wrap indicates that the current element (in $node) should be preserved. The templating module copies the current element and its attributes, before processing its children.

Parameters:
$node* $node*
$model $model
$query? $query?
$mode? $mode?
Returns:
item()*

shakes:show-hits

shakes:show-hits($node as node()*, $model as map(*), $start as xs:int) as item()*

Output the actual search result as a div, using the kwic module to summarize full text matches.

Parameters:
$node* $node*
$model $model
$start $start
Returns:
item()*