marklogic
Version:
The official MarkLogic Node.js client API.
470 lines (452 loc) • 766 kB
JavaScript
/*
* Copyright (c) 2015-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*/
'use strict';
/*
The contents of this file are mostly an output of the Optic code generator.
But some parts have been manually modified. So care needs to be taken when
running the code generator to not lose any manual modifications, each of
which should either be commented or should be obvious, such as changes in
version numbers for "since" annotations.
*/
const types = require('./server-types-generated.js');
const bldrbase = require('./plan-builder-base.js');
let patchArgs = [];
class CtsExpr {
constructor() {
}
/**
* Returns a query matching fragments committed after a specified timestamp. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.afterQuery|cts.afterQuery}
* @method planBuilder.cts#afterQuery
* @since 2.1.1
* @param { XsUnsignedLong } [timestamp] - A commit timestamp. Database fragments committed after this timestamp are matched.
* @returns { CtsQuery }
*/
afterQuery(...args) {
const paramdef = ['timestamp', [types.XsUnsignedLong], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.afterQuery', 1, paramdef, args);
return new types.CtsQuery('cts', 'after-query', checkedArgs);
}
/**
* Returns a query specifying the set difference of the matches specified by two sub-queries. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.andNotQuery|cts.andNotQuery}
* @method planBuilder.cts#andNotQuery
* @since 2.1.1
* @param { CtsQuery } [positiveQuery] - A positive query, specifying the search results filtered in.
* @param { CtsQuery } [negativeQuery] - A negative query, specifying the search results to filter out.
* @returns { CtsQuery }
*/
andNotQuery(...args) {
const namer = bldrbase.getNamer(args, 'positive-query');
const paramdefs = [['positive-query', [types.CtsQuery], true, false], ['negative-query', [types.CtsQuery], true, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.andNotQuery', 2, new Set(['positive-query', 'negative-query']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.andNotQuery', 2, false, paramdefs, args);
return new types.CtsQuery('cts', 'and-not-query', checkedArgs);
}
/**
* Returns a query specifying the intersection of the matches specified by the sub-queries. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.andQuery|cts.andQuery}
* @method planBuilder.cts#andQuery
* @since 2.1.1
* @param { CtsQuery } [queries] - A sequence of sub-queries.
* @param { XsString } [options] - Options to this query. The default is (). Options include: "ordered" An ordered and-query, which specifies that the sub-query matches must occur in the order of the specified sub-queries. For example, if the sub-queries are "cat" and "dog", an ordered query will only match fragments where both "cat" and "dog" occur, and where "cat" comes before "dog" in the fragment. "unordered" An unordered and-query, which specifies that the sub-query matches can occur in any order.
* @returns { CtsQuery }
*/
andQuery(...args) {
const namer = bldrbase.getNamer(args, 'queries');
const paramdefs = [['queries', [types.CtsQuery], false, true], ['options', [types.XsString], false, true]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.andQuery', 1, new Set(['queries', 'options']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.andQuery', 1, false, paramdefs, args);
return new types.CtsQuery('cts', 'and-query', checkedArgs);
}
/**
* Returns a query matching fragments committed before or at a specified timestamp. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.beforeQuery|cts.beforeQuery}
* @method planBuilder.cts#beforeQuery
* @since 2.1.1
* @param { XsUnsignedLong } [timestamp] - A commit timestamp. Database fragments committed before this timestamp are matched.
* @returns { CtsQuery }
*/
beforeQuery(...args) {
const paramdef = ['timestamp', [types.XsUnsignedLong], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.beforeQuery', 1, paramdef, args);
return new types.CtsQuery('cts', 'before-query', checkedArgs);
}
/**
* Returns a query specifying that matches to matching-query should have their search relevance scores boosted if they also match boosting-query. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.boostQuery|cts.boostQuery}
* @method planBuilder.cts#boostQuery
* @since 2.1.1
* @param { CtsQuery } [matchingQuery] - A sub-query that is used for match and scoring.
* @param { CtsQuery } [boostingQuery] - A sub-query that is used only for boosting score.
* @returns { CtsQuery }
*/
boostQuery(...args) {
const namer = bldrbase.getNamer(args, 'matching-query');
const paramdefs = [['matching-query', [types.CtsQuery], true, false], ['boosting-query', [types.CtsQuery], true, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.boostQuery', 2, new Set(['matching-query', 'boosting-query']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.boostQuery', 2, false, paramdefs, args);
return new types.CtsQuery('cts', 'boost-query', checkedArgs);
}
/**
* Returns a geospatial box value. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.box|cts.box}
* @method planBuilder.cts#box
* @since 2.1.1
* @param { XsDouble } [south] - The southern boundary of the box.
* @param { XsDouble } [west] - The western boundary of the box.
* @param { XsDouble } [north] - The northern boundary of the box.
* @param { XsDouble } [east] - The eastern boundary of the box.
* @returns { CtsBox }
*/
box(...args) {
const namer = bldrbase.getNamer(args, 'south');
const paramdefs = [['south', [types.XsDouble, PlanColumn, PlanParam], true, false], ['west', [types.XsDouble, PlanColumn, PlanParam], true, false], ['north', [types.XsDouble, PlanColumn, PlanParam], true, false], ['east', [types.XsDouble, PlanColumn, PlanParam], true, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.box', 4, new Set(['south', 'west', 'north', 'east']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.box', 4, false, paramdefs, args);
return new types.CtsBox('cts', 'box', checkedArgs);
}
/**
* Returns a box's eastern boundary. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.boxEast|cts.boxEast}
* @method planBuilder.cts#boxEast
* @since 2.1.1
* @param { CtsBox } [box] - The box.
* @returns { XsNumeric }
*/
boxEast(...args) {
const paramdef = ['box', [types.CtsBox, PlanColumn, PlanParam], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.boxEast', 1, paramdef, args);
return new types.XsNumeric('cts', 'box-east', checkedArgs);
}
/**
* Returns a box's northern boundary. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.boxNorth|cts.boxNorth}
* @method planBuilder.cts#boxNorth
* @since 2.1.1
* @param { CtsBox } [box] - The box.
* @returns { XsNumeric }
*/
boxNorth(...args) {
const paramdef = ['box', [types.CtsBox, PlanColumn, PlanParam], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.boxNorth', 1, paramdef, args);
return new types.XsNumeric('cts', 'box-north', checkedArgs);
}
/**
* Returns a box's southern boundary. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.boxSouth|cts.boxSouth}
* @method planBuilder.cts#boxSouth
* @since 2.1.1
* @param { CtsBox } [box] - The box.
* @returns { XsNumeric }
*/
boxSouth(...args) {
const paramdef = ['box', [types.CtsBox, PlanColumn, PlanParam], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.boxSouth', 1, paramdef, args);
return new types.XsNumeric('cts', 'box-south', checkedArgs);
}
/**
* Returns a box's western boundary. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.boxWest|cts.boxWest}
* @method planBuilder.cts#boxWest
* @since 2.1.1
* @param { CtsBox } [box] - The box.
* @returns { XsNumeric }
*/
boxWest(...args) {
const paramdef = ['box', [types.CtsBox, PlanColumn, PlanParam], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.boxWest', 1, paramdef, args);
return new types.XsNumeric('cts', 'box-west', checkedArgs);
}
/**
* Returns a geospatial circle value. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.circle|cts.circle}
* @method planBuilder.cts#circle
* @since 2.1.1
* @param { XsDouble } [radius] - The radius of the circle. The units for the radius is determined at runtime by the query options (miles is currently the only option).
* @param { CtsPoint } [center] - A point representing the center of the circle.
* @returns { CtsCircle }
*/
circle(...args) {
const namer = bldrbase.getNamer(args, 'radius');
const paramdefs = [['radius', [types.XsDouble, PlanColumn, PlanParam], true, false], ['center', [types.CtsPoint, PlanColumn, PlanParam], true, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.circle', 2, new Set(['radius', 'center']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.circle', 2, false, paramdefs, args);
return new types.CtsCircle('cts', 'circle', checkedArgs);
}
/**
* Returns a circle's center point. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.circleCenter|cts.circleCenter}
* @method planBuilder.cts#circleCenter
* @since 2.1.1
* @param { CtsCircle } [circle] - The circle.
* @returns { CtsPoint }
*/
circleCenter(...args) {
const paramdef = ['circle', [types.CtsCircle, PlanColumn, PlanParam], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.circleCenter', 1, paramdef, args);
return new types.CtsPoint('cts', 'circle-center', checkedArgs);
}
/**
* Returns a circle's radius. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.circleRadius|cts.circleRadius}
* @method planBuilder.cts#circleRadius
* @since 2.1.1
* @param { CtsCircle } [circle] - The circle.
* @returns { XsNumeric }
*/
circleRadius(...args) {
const paramdef = ['circle', [types.CtsCircle, PlanColumn, PlanParam], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.circleRadius', 1, paramdef, args);
return new types.XsNumeric('cts', 'circle-radius', checkedArgs);
}
/**
* Match documents in at least one of the specified collections. It will match both documents and properties documents in the collections with the given URIs. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.collectionQuery|cts.collectionQuery}
* @method planBuilder.cts#collectionQuery
* @since 2.1.1
* @param { XsString } [uris] - One or more collection URIs. A document matches the query if it is in at least one of these collections.
* @returns { CtsQuery }
*/
collectionQuery(...args) {
const paramdef = ['uris', [types.XsString], false, true];
const checkedArgs = bldrbase.makeSingleArgs('cts.collectionQuery', 1, paramdef, args);
return new types.CtsQuery('cts', 'collection-query', checkedArgs);
}
/**
* Creates a reference to the collection lexicon, for use as a parameter to cts:value-tuples. Since lexicons are implemented with range indexes, this function will throw an exception if the specified range index does not exist. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.collectionReference|cts.collectionReference}
* @method planBuilder.cts#collectionReference
* @since 2.1.1
* @param { XsString } [options] - Options. The default is (). Options include: "nullable" Allow null values in tuples reported from cts:value-tuples when using this lexicon. "unchecked" Do not check the definition against the context database.
* @returns { CtsReference }
*/
collectionReference(...args) {
const paramdef = ['options', [types.XsString], false, true];
const checkedArgs = bldrbase.makeSingleArgs('cts.collectionReference', 0, paramdef, args);
return new types.CtsReference('cts', 'collection-reference', checkedArgs);
}
/**
* Returns a cts:query matching documents matching a TDE-view column equals to an value. Searches with the cts:column-range-query constructor require the triple index; if the triple index is not configured, then an exception is thrown. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.columnRangeQuery|cts.columnRangeQuery}
* @method planBuilder.cts#columnRangeQuery
* @since 2.1.1
* @param { XsString } [schema] - The TDE schema name.
* @param { XsString } [view] - The TDE view name.
* @param { XsString } [column] - The TDE column name.
* @param { XsAnyAtomicType } [value] - One or more values used for querying.
* @param { XsString } [operator] - Operator for the $value values. The default operator is "=". Operators include: "<" Match range index values less than $value. "<=" Match range index values less than or equal to $value. ">" Match range index values greater than $value. ">=" Match range index values greater than or equal to $value. "=" Match range index values equal to $value. "!=" Match range index values not equal to $value.
* @param { XsString } [options] - Options to this query. The default is (). Options include: "cached" Cache the results of this query in the list cache. "uncached" Do not cache the results of this query in the list cache. "score-function=function" Use the selected scoring function. The score function may be: linearUse a linear function of the difference between the specified query value and the matching value in the index to calculate a score for this range query. reciprocalUse a reciprocal function of the difference between the specified query value and the matching value in the index to calculate a score for this range query. zeroThis range query does not contribute to the score. This is the default. "slope-factor=number" Apply the given number as a scaling factor to the slope of the scoring function. The default is 1.0.
* @param { XsDouble } [weight] - A weight for this query. The default is 1.0.
* @returns { CtsQuery }
*/
columnRangeQuery(...args) {
const namer = bldrbase.getNamer(args, 'schema');
const paramdefs = [['schema', [types.XsString], true, false], ['view', [types.XsString], true, false], ['column', [types.XsString], true, false], ['value', [types.XsAnyAtomicType], false, true], ['operator', [types.XsString], false, false], ['options', [types.XsString], false, true], ['weight', [types.XsDouble], false, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.columnRangeQuery', 4, new Set(['schema', 'view', 'column', 'value', 'operator', 'options', 'weight']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.columnRangeQuery', 4, false, paramdefs, args);
return new types.CtsQuery('cts', 'column-range-query', checkedArgs);
}
/**
* Returns a geospatial complex polygon value. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.complexPolygon|cts.complexPolygon}
* @method planBuilder.cts#complexPolygon
* @since 2.1.1
* @param { CtsPolygon } [outer] - The outer polygon.
* @param { CtsPolygon } [inner] - The inner (hole) polygons.
* @returns { CtsComplexPolygon }
*/
complexPolygon(...args) {
const namer = bldrbase.getNamer(args, 'outer');
const paramdefs = [['outer', [types.CtsPolygon, PlanColumn, PlanParam], true, false], ['inner', [types.CtsPolygon, PlanColumn, PlanParam], false, true]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.complexPolygon', 2, new Set(['outer', 'inner']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.complexPolygon', 2, false, paramdefs, args);
return new types.CtsComplexPolygon('cts', 'complex-polygon', checkedArgs);
}
/**
* Returns a query matching documents in the directories with the given URIs. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.directoryQuery|cts.directoryQuery}
* @method planBuilder.cts#directoryQuery
* @since 2.1.1
* @param { XsString } [uris] - One or more directory URIs.
* @param { XsString } [depth] - "1" for immediate children, "infinity" for all. If not supplied, depth is "1".
* @returns { CtsQuery }
*/
directoryQuery(...args) {
const namer = bldrbase.getNamer(args, 'uris');
const paramdefs = [['uris', [types.XsString], false, true], ['depth', [types.XsString], false, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.directoryQuery', 1, new Set(['uris', 'depth']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.directoryQuery', 1, false, paramdefs, args);
return new types.CtsQuery('cts', 'directory-query', checkedArgs);
}
/**
* Returns a query matching documents of a given format. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.documentFormatQuery|cts.documentFormatQuery}
* @method planBuilder.cts#documentFormatQuery
* @since 3.4.0
* @param { XsString } [format] - Case insensitve one of: "json","xml","text","binary". This will result in a XDMP-ARG exception in case of an invalid format.
* @returns { CtsQuery }
*/
documentFormatQuery(...args) {
const paramdef = ['format', [types.XsString], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.documentFormatQuery', 1, paramdef, args);
return new types.CtsQuery('cts', 'document-format-query', checkedArgs);
}
/**
* Returns a query that matches all documents where query matches any document fragment. When searching documents, document-properties, or document-locks, this function provides a convenient way to additionally constrain the search against any document fragment. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.documentFragmentQuery|cts.documentFragmentQuery}
* @method planBuilder.cts#documentFragmentQuery
* @since 2.1.1
* @param { CtsQuery } [query] - A query to be matched against any document fragment.
* @returns { CtsQuery }
*/
documentFragmentQuery(...args) {
const paramdef = ['query', [types.CtsQuery], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.documentFragmentQuery', 1, paramdef, args);
return new types.CtsQuery('cts', 'document-fragment-query', checkedArgs);
}
/**
* Returns a query matching documents with a given permission. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.documentPermissionQuery|cts.documentPermissionQuery}
* @method planBuilder.cts#documentPermissionQuery
* @since 3.4.0
* @param { XsString } [role] - The role of the permission
* @param { XsString } [capability] - The capability of the permission (read, update, node-update, insert, execute)
* @returns { CtsQuery }
*/
documentPermissionQuery(...args) {
const namer = bldrbase.getNamer(args, 'role');
const paramdefs = [['role', [types.XsString], true, false], ['capability', [types.XsString], true, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.documentPermissionQuery', 2, new Set(['role', 'capability']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.documentPermissionQuery', 2, false, paramdefs, args);
return new types.CtsQuery('cts', 'document-permission-query', checkedArgs);
}
/**
* Returns a query matching documents with the given URIs. It will match both documents and properties documents with the given URIs. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.documentQuery|cts.documentQuery}
* @method planBuilder.cts#documentQuery
* @since 2.1.1
* @param { XsString } [uris] - One or more document URIs.
* @returns { CtsQuery }
*/
documentQuery(...args) {
const paramdef = ['uris', [types.XsString], false, true];
const checkedArgs = bldrbase.makeSingleArgs('cts.documentQuery', 1, paramdef, args);
return new types.CtsQuery('cts', 'document-query', checkedArgs);
}
/**
* Returns a query matching documents with a given root element. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.documentRootQuery|cts.documentRootQuery}
* @method planBuilder.cts#documentRootQuery
* @since 3.4.0
* @param { XsQName } [root] - The root QName to query.
* @returns { CtsQuery }
*/
documentRootQuery(...args) {
const paramdef = ['root', [types.XsQName], true, false];
const checkedArgs = bldrbase.makeSingleArgs('cts.documentRootQuery', 1, paramdef, args);
return new types.CtsQuery('cts', 'document-root-query', checkedArgs);
}
/**
* Returns a query matching elements by name which has specific attributes representing latitude and longitude values for a point contained within the given geographic box, circle, or polygon, or equal to the given point. Points that lie between the southern boundary and the northern boundary of a box, travelling northwards, and between the western boundary and the eastern boundary of the box, travelling eastwards, will match. Points contained within the given radius of the center point of a circle will match, using the curved distance on the surface of the Earth. Points contained within the given polygon will match, using great circle arcs over a spherical model of the Earth as edges. An error may result if the polygon is malformed in some way. Points equal to the a given point will match, taking into account the fact that longitudes converge at the poles. Using the geospatial query constructors requires a valid geospatial license key; without a valid license key, searches that include geospatial queries will throw an exception. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.elementAttributePairGeospatialQuery|cts.elementAttributePairGeospatialQuery}
* @method planBuilder.cts#elementAttributePairGeospatialQuery
* @since 2.1.1
* @param { XsQName } [elementName] - One or more parent element QNames to match. When multiple QNames are specified, the query matches if any QName matches.
* @param { XsQName } [latitudeName] - One or more latitude attribute QNames to match. When multiple QNames are specified, the query matches if any QName matches; however, only the first matching latitude attribute in any point instance will be checked.
* @param { XsQName } [longitudeName] - One or more longitude attribute QNames to match. When multiple QNames are specified, the query matches if any QName matches; however, only the first matching longitude attribute in any point instance will be checked.
* @param { CtsRegion } [region] - One or more geographic boxes, circles, polygons, or points. Where multiple regions are specified, the query matches if any region matches.
* @param { XsString } [options] - Options to this query. The default is (). Options include: "coordinate-system=string" Use the given coordinate system. Valid values are: wgs84The WGS84 coordinate system with degrees as the angular unit. wgs84/radiansThe WGS84 coordinate system with radians as the angular unit. wgs84/doubleThe WGS84 coordinate system at double precision with degrees as the angular unit. wgs84/radians/doubleThe WGS84 coordinate system at double precision with radians as the angular unit. etrs89The ETRS89 coordinate system. etrs89/doubleThe ETRS89 coordinate system at double precision. rawThe raw (unmapped) coordinate system. raw/doubleThe raw coordinate system at double precision. "precision=value" Use the coordinate system at the given precision. Allowed values: float and double. "units=value" Measure distance and the radii of circles in the specified units. Allowed values: miles (default), km, feet, meters. "boundaries-included" Points on boxes', circles', and polygons' boundaries are counted as matching. This is the default. "boundaries-excluded" Points on boxes', circles', and polygons' boundaries are not counted as matching. "boundaries-latitude-excluded" Points on boxes' latitude boundaries are not counted as matching. "boundaries-longitude-excluded" Points on boxes' longitude boundaries are not counted as matching. "boundaries-south-excluded" Points on the boxes' southern boundaries are not counted as matching. "boundaries-west-excluded" Points on the boxes' western boundaries are not counted as matching. "boundaries-north-excluded" Points on the boxes' northern boundaries are not counted as matching. "boundaries-east-excluded" Points on the boxes' eastern boundaries are not counted as matching. "boundaries-circle-excluded" Points on circles' boundary are not counted as matching. "boundaries-endpoints-excluded" Points on linestrings' boundary (the endpoints) are not counted as matching. "cached" Cache the results of this query in the list cache. "uncached" Do not cache the results of this query in the list cache. "score-function=function" Use the selected scoring function. The score function may be: linearUse a linear function of the difference between the specified query value and the matching value in the index to calculate a score for this range query. reciprocalUse a reciprocal function of the difference between the specified query value and the matching value in the index to calculate a score for this range query. zeroThis range query does not contribute to the score. This is the default. "slope-factor=number" Apply the given number as a scaling factor to the slope of the scoring function. The default is 1.0. "synonym" Specifies that all of the terms in the $regions parameter are considered synonyms for scoring purposes. The result is that occurrences of more than one of the synonyms are scored as if there are more occurrence of the same term (as opposed to having a separate term that contributes to score).
* @param { XsDouble } [weight] - A weight for this query. The default is 1.0.
* @returns { CtsQuery }
*/
elementAttributePairGeospatialQuery(...args) {
const namer = bldrbase.getNamer(args, 'element-name');
const paramdefs = [['element-name', [types.XsQName], false, true], ['latitude-name', [types.XsQName], false, true], ['longitude-name', [types.XsQName], false, true], ['region', [types.CtsRegion], false, true], ['options', [types.XsString], false, true], ['weight', [types.XsDouble], false, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.elementAttributePairGeospatialQuery', 4, new Set(['element-name', 'latitude-name', 'longitude-name', 'region', 'options', 'weight']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.elementAttributePairGeospatialQuery', 4, false, paramdefs, args);
return new types.CtsQuery('cts', 'element-attribute-pair-geospatial-query', checkedArgs);
}
/**
* Constructs a query that matches element-attributes by name with a range-index entry equal to a given value. An element attribute range index on the specified QName(s) must exist when you use this query in a search; if no such range index exists, the search throws an exception. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.elementAttributeRangeQuery|cts.elementAttributeRangeQuery}
* @method planBuilder.cts#elementAttributeRangeQuery
* @since 2.1.1
* @param { XsQName } [elementName] - One or more element QNames to match. When multiple QNames are specified, the query matches if any QName matches.
* @param { XsQName } [attributeName] - One or more attribute QNames to match. When multiple QNames are specified, the query matches if any QName matches.
* @param { XsString } [operator] - A comparison operator. Operators include: "<" Match range index values less than $value. "<=" Match range index values less than or equal to $value. ">" Match range index values greater than $value. ">=" Match range index values greater than or equal to $value. "=" Match range index values equal to $value. "!=" Match range index values not equal to $value.
* @param { XsAnyAtomicType } [value] - Some values to match. When multiple values are specified, the query matches if any value matches.
* @param { XsString } [options] - Options to this query. The default is (). Options include: "collation=URI" Use the range index with the collation specified by URI. If not specified, then the default collation from the query is used. If a range index with the specified collation does not exist, an error is thrown. "cached" Cache the results of this query in the list cache. "uncached" Do not cache the results of this query in the list cache. "cached-incremental" When querying on a short date or dateTime range, break the query into sub-queries on smaller ranges, and then cache the results of each. See the Usage Notes for details. "min-occurs=number" Specifies the minimum number of occurrences required. If fewer that this number of words occur, the fragment does not match. The default is 1. "max-occurs=number" Specifies the maximum number of occurrences required. If more than this number of words occur, the fragment does not match. The default is unbounded. "score-function=function" Use the selected scoring function. The score function may be: linearUse a linear function of the difference between the specified query value and the matching value in the index to calculate a score for this range query. reciprocalUse a reciprocal function of the difference between the specified query value and the matching value in the index to calculate a score for this range query. zeroThis range query does not contribute to the score. This is the default. "slope-factor=number" Apply the given number as a scaling factor to the slope of the scoring function. The default is 1.0. "synonym" Specifies that all of the terms in the $value parameter are considered synonyms for scoring purposes. The result is that occurrences of more than one of the synonyms are scored as if there are more occurrences of the same term (as opposed to having a separate term that contributes to score).
* @param { XsDouble } [weight] - A weight for this query. The default is 1.0.
* @returns { CtsQuery }
*/
elementAttributeRangeQuery(...args) {
const namer = bldrbase.getNamer(args, 'element-name');
const paramdefs = [['element-name', [types.XsQName], false, true], ['attribute-name', [types.XsQName], false, true], ['operator', [types.XsString], true, false], ['value', [types.XsAnyAtomicType], false, true], ['options', [types.XsString], false, true], ['weight', [types.XsDouble], false, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.elementAttributeRangeQuery', 4, new Set(['element-name', 'attribute-name', 'operator', 'value', 'options', 'weight']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.elementAttributeRangeQuery', 4, false, paramdefs, args);
return new types.CtsQuery('cts', 'element-attribute-range-query', checkedArgs);
}
/**
* Creates a reference to an element attribute value lexicon, for use as a parameter to cts:value-tuples. Since lexicons are implemented with range indexes, this function will throw an exception if the specified range index does not exist. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.elementAttributeReference|cts.elementAttributeReference}
* @method planBuilder.cts#elementAttributeReference
* @since 2.1.1
* @param { XsQName } [element] - An element QName.
* @param { XsQName } [attribute] - An attribute QName.
* @param { XsString } [options] - Options. The default is (). Options include: "type=type" Use the lexicon with the type specified by type (int, unsignedInt, long, unsignedLong, float, double, decimal, dateTime, time, date, gYearMonth, gYear, gMonth, gDay, yearMonthDuration, dayTimeDuration, string, anyURI, point, or long-lat-point) "collation=URI" Use the lexicon with the collation specified by URI. "nullable" Allow null values in tuples reported from cts:value-tuples when using this lexicon. "unchecked" Read the scalar type, collation and coordinate-system info only from the input. Do not check the definition against the context database. "coordinate-system=name" Create a reference to an index or lexicon based on the specified coordinate system. Allowed values: "wgs84", "wgs84/double", "raw", "raw/double". Only applicable if the index/lexicon value type is point or long-lat-point. "precision=value" Create a reference to an index or lexicon configured with the specified geospatial precision. Allowed values: float and double. Only applicable if the index/lexicon value type is point or long-lat-point. This value takes precedence over the precision implicit in the coordinate system name.
* @returns { CtsReference }
*/
elementAttributeReference(...args) {
const namer = bldrbase.getNamer(args, 'element');
const paramdefs = [['element', [types.XsQName], true, false], ['attribute', [types.XsQName], true, false], ['options', [types.XsString], false, true]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.elementAttributeReference', 2, new Set(['element', 'attribute', 'options']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.elementAttributeReference', 2, false, paramdefs, args);
return new types.CtsReference('cts', 'element-attribute-reference', checkedArgs);
}
/**
* Returns a query matching elements by name with attributes by name with text content equal a given phrase. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.elementAttributeValueQuery|cts.elementAttributeValueQuery}
* @method planBuilder.cts#elementAttributeValueQuery
* @since 2.1.1
* @param { XsQName } [elementName] - One or more element QNames to match. When multiple QNames are specified, the query matches if any QName matches.
* @param { XsQName } [attributeName] - One or more attribute QNames to match. When multiple QNames are specified, the query matches if any QName matches.
* @param { XsString } [text] - One or more attribute values to match. When multiple strings are specified, the query matches if any string matches.
* @param { XsString } [options] - Options to this query. The default is (). Options include: "case-sensitive" A case-sensitive query. "case-insensitive" A case-insensitive query. "diacritic-sensitive" A diacritic-sensitive query. "diacritic-insensitive" A diacritic-insensitive query. "punctuation-sensitive" A punctuation-sensitive query. "punctuation-insensitive" A punctuation-insensitive query. "whitespace-sensitive" A whitespace-sensitive query. "whitespace-insensitive" A whitespace-insensitive query. "stemmed" A stemmed query. "unstemmed" An unstemmed query. "wildcarded" A wildcarded query. "unwildcarded" An unwildcarded query. "exact" An exact match query. Shorthand for "case-sensitive", "diacritic-sensitive", "punctuation-sensitive", "whitespace-sensitive", "unstemmed", and "unwildcarded". "lang=iso639code" Specifies the language of the query. The iso639code code portion is case-insensitive, and uses the languages specified by ISO 639. The default is specified in the database configuration. "min-occurs=number" Specifies the minimum number of occurrences required. If fewer that this number of words occur, the fragment does not match. The default is 1. "max-occurs=number" Specifies the maximum number of occurrences required. If more than this number of words occur, the fragment does not match. The default is unbounded. "synonym" Specifies that all of the terms in the $text parameter are considered synonyms for scoring purposes. The result is that occurrences of more than one of the synonyms are scored as if there are more occurrences of the same term (as opposed to having a separate term that contributes to score).
* @param { XsDouble } [weight] - A weight for this query. Higher weights move search results up in the relevance order. The default is 1.0. The weight should be between 64 and -16. Weights greater than 64 will have the same effect as a weight of 64. Weights less than the absolute value of 0.0625 (between -0.0625 and 0.0625) are rounded to 0, which means that they do not contribute to the score.
* @returns { CtsQuery }
*/
elementAttributeValueQuery(...args) {
const namer = bldrbase.getNamer(args, 'element-name');
const paramdefs = [['element-name', [types.XsQName], false, true], ['attribute-name', [types.XsQName], false, true], ['text', [types.XsString], false, true], ['options', [types.XsString], false, true], ['weight', [types.XsDouble], false, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.elementAttributeValueQuery', 3, new Set(['element-name', 'attribute-name', 'text', 'options', 'weight']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.elementAttributeValueQuery', 3, false, paramdefs, args);
return new types.CtsQuery('cts', 'element-attribute-value-query', checkedArgs);
}
/**
* Returns a query matching elements by name with attributes by name with text content containing a given phrase. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.elementAttributeWordQuery|cts.elementAttributeWordQuery}
* @method planBuilder.cts#elementAttributeWordQuery
* @since 2.1.1
* @param { XsQName } [elementName] - One or more element QNames to match. When multiple QNames are specified, the query matches if any QName matches.
* @param { XsQName } [attributeName] - One or more attribute QNames to match. When multiple QNames are specified, the query matches if any QName matches.
* @param { XsString } [text] - Some words or phrases to match. When multiple strings are specified, the query matches if any string matches.
* @param { XsString } [options] - Options to this query. The default is (). Options include: "case-sensitive" A case-sensitive query. "case-insensitive" A case-insensitive query. "diacritic-sensitive" A diacritic-sensitive query. "diacritic-insensitive" A diacritic-insensitive query. "punctuation-sensitive" A punctuation-sensitive query. "punctuation-insensitive" A punctuation-insensitive query. "whitespace-sensitive" A whitespace-sensitive query. "whitespace-insensitive" A whitespace-insensitive query. "stemmed" A stemmed query. "unstemmed" An unstemmed query. "wildcarded" A wildcarded query. "unwildcarded" An unwildcarded query. "exact" An exact match query. Shorthand for "case-sensitive", "diacritic-sensitive", "punctuation-sensitive", "whitespace-sensitive", "unstemmed", and "unwildcarded". "lang=iso639code" Specifies the language of the query. The iso639code code portion is case-insensitive, and uses the languages specified by ISO 639. The default is specified in the database configuration. "min-occurs=number" Specifies the minimum number of occurrences required. If fewer that this number of words occur, the fragment does not match. The default is 1. "max-occurs=number" Specifies the maximum number of occurrences required. If more than this number of words occur, the fragment does not match. The default is unbounded. "synonym" Specifies that all of the terms in the $text parameter are considered synonyms for scoring purposes. The result is that occurrences of more than one of the synonyms are scored as if there are more occurrences of the same term (as opposed to having a separate term that contributes to score). "lexicon-expand=value" The value is one of full, prefix-postfix, off, or heuristic (the default is heuristic). An option with a value of lexicon-expand=full specifies that wildcards are resolved by expanding the pattern to words in a lexicon (if there is one available), and turning into a series of cts:word-queries, even if this takes a long time to evaluate. An option with a value of lexicon-expand=prefix-postfix specifies that wildcards are resolved by expanding the pattern to the pre- and postfixes of the words in the word lexicon (if there is one), and turning the query into a series of character queries, even if it takes a long time to evaluate. An option with a value of lexicon-expand=off specifies that wildcards are only resolved by looking up character patterns in the search pattern index, not in the lexicon. An option with a value of lexicon-expand=heuristic, which is the default, specifies that wildcards are resolved by using a series of internal rules, such as estimating the number of lexicon entries that need to be scanned, seeing if the estimate crosses certain thresholds, and (if appropriate), using another way besides lexicon expansion to resolve the query. * "lexicon-expansion-limit=number" Specifies the limit for lexicon expansion. This puts a restriction on the number of lexicon expansions that can be performed. If the limit is exceeded, the server may raise an error depending on whether the "limit-check" option is set. The default value for this option will be 4096. "limit-check" Specifies that an error will be raised if the lexicon expansion exceeds the specified limit. "no-limit-check" Specifies that error will not be raised if the lexicon expansion exceeds the specified limit. The server will try to resolve the wildcard.
* @param { XsDouble } [weight] - A weight for this query. Higher weights move search results up in the relevance order. The default is 1.0. The weight should be between 64 and -16. Weights greater than 64 will have the same effect as a weight of 64. Weights less than the absolute value of 0.0625 (between -0.0625 and 0.0625) are rounded to 0, which means that they do not contribute to the score.
* @returns { CtsQuery }
*/
elementAttributeWordQuery(...args) {
const namer = bldrbase.getNamer(args, 'element-name');
const paramdefs = [['element-name', [types.XsQName], false, true], ['attribute-name', [types.XsQName], false, true], ['text', [types.XsString], false, true], ['options', [types.XsString], false, true], ['weight', [types.XsDouble], false, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.elementAttributeWordQuery', 3, new Set(['element-name', 'attribute-name', 'text', 'options', 'weight']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.elementAttributeWordQuery', 3, false, paramdefs, args);
return new types.CtsQuery('cts', 'element-attribute-word-query', checkedArgs);
}
/**
* Returns a query matching elements by name which has specific element children representing latitude and longitude values for a point contained within the given geographic box, circle, or polygon, or equal to the given point. Points that lie between the southern boundary and the northern boundary of a box, travelling northwards, and between the western boundary and the eastern boundary of the box, travelling eastwards, will match. Points contained within the given radius of the center point of a circle will match, using the curved distance on the surface of the Earth. Points contained within the given polygon will match, using great circle arcs over a spherical model of the Earth as edges. An error may result if the polygon is malformed in some way. Points equal to the a given point will match, taking into account the fact that longitudes converge at the poles. Using the geospatial query constructors requires a valid geospatial license key; without a valid license key, searches that include geospatial queries will throw an exception. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.elementChildGeospatialQuery|cts.elementChildGeospatialQuery}
* @method planBuilder.cts#elementChildGeospatialQuery
* @since 2.1.1
* @param { XsQName } [elementName] - One or more parent element QNames to match. When multiple QNames are specified, the query matches if any QName matches.
* @param { XsQName } [childName] - One or more child element QNames to match. When multiple QNames are specified, the query matches if any QName matches; however, only the first matching latitude child in any point instance will be checked. The element must specify both latitude and longitude coordinates.
* @param { CtsRegion } [region] - One or more geographic boxes, circles, polygons, or points. Where multiple regions are specified, the query matches if any region matches.
* @param { XsString } [options] - Options to this query. The default is (). Options include: "coordinate-system=string" Use the given coordinate system. Valid values are: wgs84The WGS84 coordinate system with degrees as the angular unit. wgs84/radiansThe WGS84 coordinate system with radians as the angular unit. wgs84/doubleThe WGS84 coordinate system at double precision with degrees as the angular unit. wgs84/radians/doubleThe WGS84 coordinate system at double precision with radians as the angular unit. etrs89The ETRS89 coordinate system. etrs89/doubleThe ETRS89 coordinate system at double precision. rawThe raw (unmapped) coordinate system. raw/doubleThe raw coordinate system at double precision. "precision=string" Use the coordinate system at the given precision. Allowed values: float (default) and double. "units=value" Measure distance and the radii of circles in the specified units. Allowed values: miles (default), km, feet, meters. "boundaries-included" Points on boxes', circles', and polygons' boundaries are counted as matching. This is the default. "boundaries-excluded" Points on boxes', circles', and polygons' boundaries are not counted as matching. "boundaries-latitude-excluded" Points on boxes' latitude boundaries are not counted as matching. "boundaries-longitude-excluded" Points on boxes' longitude boundaries are not counted as matching. "boundaries-south-excluded" Points on the boxes' southern boundaries are not counted as matching. "boundaries-west-excluded" Points on the boxes' western boundaries are not counted as matching. "boundaries-north-excluded" Points on the boxes' northern boundaries are not counted as matching. "boundaries-east-excluded" Points on the boxes' eastern boundaries are not counted as matching. "boundaries-circle-excluded" Points on circles' boundary are not counted as matching. "boundaries-endpoints-excluded" Points on linestrings' boundary (the endpoints) are not counted as matching. "cached" Cache the results of this query in the list cache. "uncached" Do not cache the results of this query in the list cache. "type=long-lat-point" Specifies the format for the point in the data as longitude first, latitude second. "type=point" Specifies the format for the point in the data as latitude first, longitude second. This is the default format. "score-function=function" Use the selected scoring function. The score function may be: linearUse a linear function of the difference between the specified query value and the matching value in the index to calculate a score for this range query. reciprocalUse a reciprocal function of the difference between the specified query value and the matching value in the index to calculate a score for this range query. zeroThis range query does not contribute to the score. This is the default. "slope-factor=number" Apply the given number as a scaling factor to the slope of the scoring function. The default is 1.0. "synonym" Specifies that all of the terms in the $regions parameter are considered synonyms for scoring purposes. The result is that occurrences of more than one of the synonyms are scored as if there are more occurrence of the same term (as opposed to having a separate term that contributes to score).
* @param { XsDouble } [weight] - A weight for this query. The default is 1.0.
* @returns { CtsQuery }
*/
elementChildGeospatialQuery(...args) {
const namer = bldrbase.getNamer(args, 'element-name');
const paramdefs = [['element-name', [types.XsQName], false, true], ['child-name', [types.XsQName], false, true], ['region', [types.CtsRegion], false, true], ['options', [types.XsString], false, true], ['weight', [types.XsDouble], false, false]];
const checkedArgs = (namer !== null) ?
bldrbase.makeNamedArgs(namer, 'cts.elementChildGeospatialQuery', 3, new Set(['element-name', 'child-name', 'region', 'options', 'weight']), paramdefs, args) :
bldrbase.makePositionalArgs('cts.elementChildGeospatialQuery', 3, false, paramdefs, args);
return new types.CtsQuery('cts', 'element-child-geospatial-query', checkedArgs);
}
/**
* Returns a query matching elements by name whose content represents a point contained within the given geographic box, circle, or polygon, or equal to the given point. Points that lie between the southern boundary and the northern boundary of a box, travelling northwards, and between the western boundary and the eastern boundary of the box, travelling eastwards, will match. Points conta