MarkLogic 12 EA 1 Product Documentation
admin:database-range-path-index

admin:database-range-path-index(
   $database-id as xs:unsignedLong,
   $scalar-type as xs:string,
   $pathexpr as xs:string,
   $collation as xs:string?,
   $range-value-positions as xs:boolean,
   $invalid-values as xs:string
) as element(db:range-path-index)

Summary

This function constructs a path range index specification.

Parameters
database-id The ID of the database (for example, xdmp:database("myDatabase") ).
scalar-type A valid type for the range index. Must be one of: int, unsignedInt, long, unsignedLong, float, double, decimal, dateTime, time, date, gYearMonth, gYear, gMonth, gDay, yearMonthDuration, dayTimeDuration, string, anyURI, or point.
pathexpr A valid XPath expression.
collation The collation URI (for example, http://marklogic.com/collation/). The collation is only needed for string and anyURI indexes; for other indexes, specify the empty string ("") for this parameter.
range-value-positions A boolean specifying whether to maintain value positions in this index (used with co-occurrences).
invalid-values An option to handle values that do not meet the range index type. Must be one of: reject, ignore.

Example


  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

  admin:database-range-path-index(
  xdmp:database('Documents'),
  "string",
  "/a/b/c",
  "http://marklogic.com/collation/",
  fn:false(),
  "ignore")
  =>
  <range-path-index xmlns="http://marklogic.com/xdmp/database">
    <scalar-type>string</scalar-type>
    <path-expression>/a/b/c</path-expression>
    <collation>http://marklogic.com/collation/</collation>
    <range-value-positions>false</range-value-positions>
    <invalid-values>ignore</invalid-values>
  </range-path-index>
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy