Loading TOC...

MarkLogic 12 EA 1 Product Documentation
admin.databaseGeospatialPathIndex

admin.databaseGeospatialPathIndex(
   pathexpr as String,
   coordinate-system as String,
   range-value-positions as Boolean,
   point-format as String,
   invalid-values as String
) as element(db.geospatialPathIndex)

Summary

This function constructs a geospatial path index specification. For usage details, see Geospatial Path Point Queries and Indexes in the Search Developer's Guide.

Parameters
pathexpr A valid XPath expression.
coordinate-system The coordinate system. Must be one of wgs84, wgs84/double, etrs89, etrs89/double, raw, raw/double.
range-value-positions A boolean specifying whether to maintain value positions in this index (used with co-occurrences).
point-format The point format in the data: "point" means latitude precedes longitude (this is the default); "long-lat-point" means longitude precedes latitude. To use the default value of "point", simply omit this parameter. Do not specify an empty string.
invalid-values An option to handle values that do not meet the range index type. Must be one of: reject, ignore.

Example

const admin = require('/MarkLogic/admin.xqy');
admin.databaseGeospatialPathIndex(
  "/aaa.a/aaa.b",
  "wgs84",
  fn.false(),
  "longLatPoint",
  "reject" )
=>

<geospatialPathIndex xmlns="http://marklogic.com/xdmp/database">
  <pathExpression>/aaa.a/aaa.b</pathExpression>
  <coordinateSystem>wgs84</coordinateSystem>
  <pointFormat>longLatPoint</pointFormat>
  <rangeValuePositions>false</rangeValuePositions>
  <invalidValues>reject</invalidValues>
</geospatialPathIndex>
    

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