Skip to content

Commit

Permalink
marklogic-community#492 range-field-index functions exist for all sup…
Browse files Browse the repository at this point in the history
…ported ML versions
  • Loading branch information
dmcassel committed Jan 17, 2017
1 parent 1ec835c commit f910182
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions deploy/lib/xquery/setup.xqy
Original file line number Diff line number Diff line change
Expand Up @@ -2410,32 +2410,12 @@ declare function setup:remove-existing-geospatial-element-indexes(

declare function setup:validate-range-field-indexes($admin-config, $database, $db-config)
{
try
{
let $existing :=
xdmp:eval('
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
declare namespace db="http://marklogic.com/xdmp/database";
declare variable $admin-config external;
declare variable $database external;
admin:database-get-range-field-indexes($admin-config, $database)',
(xs:QName("admin-config"), $admin-config,
xs:QName("database"), $database))
for $expected in $db-config/db:range-field-indexes/db:range-field-index
return
if ($existing[fn:deep-equal(., $expected)]) then ()
else
setup:validation-fail(fn:concat("Database mismatched range field index: ", $expected/db:field-name))
}
catch($ex)
{
if ($ex/error:code = "XDMP-UNDFUN") then $admin-config
let $existing := admin:database-get-range-field-indexes($admin-config, $database)
for $expected in $db-config/db:range-field-indexes/db:range-field-index
return
if ($existing[fn:deep-equal(., $expected)]) then ()
else
xdmp:rethrow()
}
setup:validation-fail(fn:concat("Database mismatched range field index: ", $expected/db:field-name))
};

declare function setup:add-geospatial-element-indexes(
Expand Down

0 comments on commit f910182

Please sign in to comment.