Skip to content

Instantly share code, notes, and snippets.

@claudius108
Last active November 27, 2020 08:14
Show Gist options
  • Save claudius108/37aea79dd3c2f61f83ffd6748f264425 to your computer and use it in GitHub Desktop.
Save claudius108/37aea79dd3c2f61f83ffd6748f264425 to your computer and use it in GitHub Desktop.
local:add-index-configuration-file()
declare function local:add-index-configuration-file($collection-path as xs:string) {
let $index-collection-path := $system-config-collection-path || $collection-path
return (
if (not(xmldb:collection-available($index-collection-path)))
then local:create-collections-recursively($system-config-collection-path, tokenize($collection-path, "/"))
else ()
,
xmldb:store-files-from-pattern($index-collection-path, $dir, "modules/indexes" || $collection-path || "/*.xconf")
,
xmldb:reindex($collection-path)
)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment