Loading TOC...

admin.databaseRangeElementAttributeIndex

admin.databaseRangeElementAttributeIndex(
   $scalar-type as String,
   $parent-namespace as String?,
   $parent-localname as String,
   $namespace as String?,
   $localname as String,
   $collation as String?,
   $range-value-positions as Boolean,
   [$invalid-values as String]
) as element(db.rangeElementAttributeIndex)

Summary

This function constructs a range element attribute index specification.

Parameters
$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.
$parent-namespace The namespace of the parent element for the attribute.
$parent-localname The local name of the parent element for the attribute.
$namespace The namespace URI.
$localname The local name for the node.
$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


  const admin = require('/MarkLogic/admin.xqy');

  admin.databaseRangeElementAttributeIndex("string", "/my/namespace",
        "elementname", "myAttribute", "", "http://marklogic.com/collation/",
        false )
  // returns the range element attribute-index specification
  

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