admin.databaseAddGeospatialRegionPathIndex( config as element(configuration), database-id as (Number|String), geospatial-region-path-indexes as element(db.geospatialRegionPathIndex)[] ) as element(configuration)
This function adds a geospatial region path index to the specified database in the configuration.
Parameters | |
---|---|
config | A configuration specification, typically as returned from one of the Admin module functions. |
database-id | The ID of the database (for example, xdmp:database("myDatabase")). |
geospatial-region-path-indexes | A geospatial path index specification, typically the result of calling admin:database-geospatial-region-path-index. |
http://marklogic.com/xdmp/privileges/admin/database
http://marklogic.com/xdmp/privileges/admin/database/{id}
http://marklogic.com/xdmp/privileges/admin/database/index
http://marklogic.com/xdmp/privileges/admin/database/index/{id}
admin:save-configuration
.
You can also pass the returned configuration to another Admin API
function to make additional configuration changes.
const admin = require('/MarkLogic/admin.xqy'); var config = admin.getConfiguration() admin.saveConfiguration( admin.databaseAddGeospatialRegionPathIndex( config, admin.databaseGetId(config, "geo"), admin.databaseGeospatialRegionPathIndex( "//kml.LinearRing/kml.coordinates", "wgs84", 2, "reject", "miles") ) ) //Adds a geospatial region path index to the database named "geo".