Loading TOC...

MarkLogic 12 EA 2 Product Documentation
admin.databaseAddGeospatialRegionPathIndex

admin.databaseAddGeospatialRegionPathIndex(
   config as element(configuration),
   database-id as (Number|String),
   geospatial-region-path-indexes as element(db.geospatialRegionPathIndex)[]
) as element(configuration)

Summary

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.

Required Privileges

This operation requires at least one of the following privileges:

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}

Usage Notes

The index is not created until you pass the modified configuration to admin:save-configuration. You can also pass the returned configuration to another Admin API function to make additional configuration changes.

Example

const admin = require('/MarkLogic/admin.xqy');
const 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". 
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.