diff --git a/lib/plan-builder-generated.js b/lib/plan-builder-generated.js index 2ff8be23..6daed766 100755 --- a/lib/plan-builder-generated.js +++ b/lib/plan-builder-generated.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 MarkLogic Corporation + * Copyright (c) 2003-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -425,7 +425,7 @@ elementAttributeReference(...args) { * @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). * "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 { 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 } */ @@ -578,7 +578,7 @@ elementReference(...args) { * @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 { XsString } [text] - One or more element 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). "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 { 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 } */ @@ -597,7 +597,7 @@ elementValueQuery(...args) { * @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 { 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. "distance-weight=number" A weight applied based on the minimum distance between matches of this query. Higher weights add to the importance of proximity (as opposed to term matches) when the relevance order is calculated. The default value is 0.0 (no impact of proximity). The weight should be between 64 and -16. Weights greater than 64 will have the same effect as a weight of 64. This parameter has no effect if the word positions index is not enabled. This parameter has no effect on searches that use score-simple, score-random, or score-zero (because those scoring algorithms do not consider term frequency, proximity is irrelevant). "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 { 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. "distance-weight=number" A weight applied based on the minimum distance between matches of this query. Higher weights add to the importance of proximity (as opposed to term matches) when the relevance order is calculated. The default value is 0.0 (no impact of proximity). The weight should be between 64 and -16. Weights greater than 64 will have the same effect as a weight of 64. This parameter has no effect if the word positions index is not enabled. This parameter has no effect on searches that use score-simple, score-random, or score-zero (because those scoring algorithms do not consider term frequency, proximity is irrelevant). "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. "no-limit-check" is default, if neither "limit-check" nor "no-limit-check" is explicitly specified. * @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 } */ @@ -886,7 +886,7 @@ jsonPropertyScopeQuery(...args) { * @since 2.1.1 * @param { XsString } [propertyName] - One or more property names to match. When multiple names are specified, the query matches if any name matches. * @param { XsAnyAtomicType } [value] - One or more property values to match. When multiple values are specified, the query matches if any value matches. The values can be strings, numbers or booleans to match correspondingly typed nodes. If the value is the empty sequence, the query matches null. - * @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-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 { 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 } */ @@ -905,7 +905,7 @@ jsonPropertyValueQuery(...args) { * @since 2.1.1 * @param { XsString } [propertyName] - One or more JSON property names to match. When multiple names are specified, the query matches if any name 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. "distance-weight=number" A weight applied based on the minimum distance between matches of this query. Higher weights add to the importance of proximity (as opposed to term matches) when the relevance order is calculated. The default value is 0.0 (no impact of proximity). The weight should be between 64 and -16. Weights greater than 64 will have the same effect as a weight of 64. This parameter has no effect if the word positions index is not enabled. This parameter has no effect on searches that use score-simple, score-random, or score-zero (because those scoring algorithms do not consider term frequency, proximity is irrelevant). "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 { 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. "distance-weight=number" A weight applied based on the minimum distance between matches of this query. Higher weights add to the importance of proximity (as opposed to term matches) when the relevance order is calculated. The default value is 0.0 (no impact of proximity). The weight should be between 64 and -16. Weights greater than 64 will have the same effect as a weight of 64. This parameter has no effect if the word positions index is not enabled. This parameter has no effect on searches that use score-simple, score-random, or score-zero (because those scoring algorithms do not consider term frequency, proximity is irrelevant). "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. "no-limit-check" is default, if neither "limit-check" nor "no-limit-check" is explicitly specified. * @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 } */ @@ -922,7 +922,7 @@ jsonPropertyWordQuery(...args) { * Returns a geospatial linestring value. Provides a client interface to a server function. See {@link http://docs.marklogic.com/cts.linestring|cts.linestring} * @method planBuilder.cts#linestring * @since 2.1.1 - * @param { XsAnyAtomicType } [vertices] - The waypoints of the linestring, given in order. vertexes. + * @param { XsAnyAtomicType } [vertices] - The waypoints of the linestring, given in order. Alternatively, the vertices may be provided as a string that follows the well-known text (WKT) scheme for a linestring. * @returns { CtsLinestring } */ linestring(...args) { @@ -1321,7 +1321,7 @@ uriReference(...args) { * @method planBuilder.cts#wordQuery * @since 2.1.1 * @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. "distance-weight=number" A weight applied based on the minimum distance between matches of this query. Higher weights add to the importance of proximity (as opposed to term matches) when the relevance order is calculated. The default value is 0.0 (no impact of proximity). The weight should be between 64 and -16. Weights greater than 64 will have the same effect as a weight of 64. This parameter has no effect if the word positions index is not enabled. This parameter has no effect on searches that use score-simple, score-random, or score-zero (because those scoring algorithms do not consider term frequency, proximity is irrelevant). "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 { 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. "distance-weight=number" A weight applied based on the minimum distance between matches of this query. Higher weights add to the importance of proximity (as opposed to term matches) when the relevance order is calculated. The default value is 0.0 (no impact of proximity). The weight should be between 64 and -16. Weights greater than 64 will have the same effect as a weight of 64. This parameter has no effect if the word positions index is not enabled. This parameter has no effect on searches that use score-simple, score-random, or score-zero (because those scoring algorithms do not consider term frequency, proximity is irrelevant). "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. "no-limit-check" is default, if neither "limit-check" nor "no-limit-check" is explicitly specified. * @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 } */ @@ -5319,7 +5319,7 @@ class VecExpr { */ add(...args) { const namer = bldrbase.getNamer(args, 'vector1'); - const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], true, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], true, false]]; + const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], false, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], false, false]]; const checkedArgs = (namer !== null) ? bldrbase.makeNamedArgs(namer, 'vec.add', 2, new Set(['vector1', 'vector2']), paramdefs, args) : bldrbase.makePositionalArgs('vec.add', 2, false, paramdefs, args); @@ -5334,7 +5334,7 @@ add(...args) { * @returns { VecVector } */ base64Decode(...args) { - const paramdef = ['base64-vector', [types.XsString, PlanColumn, PlanParam], true, false]; + const paramdef = ['base64-vector', [types.XsString, PlanColumn, PlanParam], false, false]; const checkedArgs = bldrbase.makeSingleArgs('vec.base64Decode', 1, paramdef, args); return new types.VecVector('vec', 'base64-decode', checkedArgs); } @@ -5346,25 +5346,42 @@ base64Decode(...args) { * @returns { XsString } */ base64Encode(...args) { - const paramdef = ['vector1', [types.VecVector, PlanColumn, PlanParam], true, false]; + const paramdef = ['vector1', [types.VecVector, PlanColumn, PlanParam], false, false]; const checkedArgs = bldrbase.makeSingleArgs('vec.base64Encode', 1, paramdef, args); return new types.XsString('vec', 'base64-encode', checkedArgs); } /** - * Returns the cosine similarity between two vectors. The vectors must be of the same dimension. Provides a client interface to a server function. See {@link http://docs.marklogic.com/vec.cosineSimilarity|vec.cosineSimilarity} - * @method planBuilder.vec#cosineSimilarity - * @since 3.5.0 - * @param { VecVector } [vector1] - The vector from which to calculate the cosine similarity with vector2. - * @param { VecVector } [vector2] - The vector from which to calculate the cosine similarity with vector1. + * Returns the cosine of the angle between two vectors. The vectors must be of the same dimension. Provides a client interface to a server function. See {@link http://docs.marklogic.com/vec.cosine|vec.cosine} + * @method planBuilder.vec#cosine + * @since 3.7.0 + * @param { VecVector } [vector1] - The vector from which to calculate the cosine with vector2. + * @param { VecVector } [vector2] - The vector from which to calculate the cosine with vector1. + * @returns { XsDouble } + */ +cosine(...args) { + const namer = bldrbase.getNamer(args, 'vector1'); + const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], false, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], false, false]]; + const checkedArgs = (namer !== null) ? + bldrbase.makeNamedArgs(namer, 'vec.cosine', 2, new Set(['vector1', 'vector2']), paramdefs, args) : + bldrbase.makePositionalArgs('vec.cosine', 2, false, paramdefs, args); + return new types.XsDouble('vec', 'cosine', checkedArgs); + + } +/** + * Returns the cosine distance between two vectors. The vectors must be of the same dimension. Provides a client interface to a server function. See {@link http://docs.marklogic.com/vec.cosineDistance|vec.cosineDistance} + * @method planBuilder.vec#cosineDistance + * @since 3.7.0 + * @param { VecVector } [vector1] - The vector from which to calculate the cosine distance to vector2. + * @param { VecVector } [vector2] - The vector from which to calculate the cosine distance to vector1. * @returns { XsDouble } */ -cosineSimilarity(...args) { +cosineDistance(...args) { const namer = bldrbase.getNamer(args, 'vector1'); - const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], true, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], true, false]]; + const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], false, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], false, false]]; const checkedArgs = (namer !== null) ? - bldrbase.makeNamedArgs(namer, 'vec.cosineSimilarity', 2, new Set(['vector1', 'vector2']), paramdefs, args) : - bldrbase.makePositionalArgs('vec.cosineSimilarity', 2, false, paramdefs, args); - return new types.XsDouble('vec', 'cosine-similarity', checkedArgs); + bldrbase.makeNamedArgs(namer, 'vec.cosineDistance', 2, new Set(['vector1', 'vector2']), paramdefs, args) : + bldrbase.makePositionalArgs('vec.cosineDistance', 2, false, paramdefs, args); + return new types.XsDouble('vec', 'cosine-distance', checkedArgs); } /** @@ -5375,7 +5392,7 @@ cosineSimilarity(...args) { * @returns { XsUnsignedInt } */ dimension(...args) { - const paramdef = ['vector1', [types.VecVector, PlanColumn, PlanParam], true, false]; + const paramdef = ['vector1', [types.VecVector, PlanColumn, PlanParam], false, false]; const checkedArgs = bldrbase.makeSingleArgs('vec.dimension', 1, paramdef, args); return new types.XsUnsignedInt('vec', 'dimension', checkedArgs); } @@ -5389,7 +5406,7 @@ dimension(...args) { */ dotProduct(...args) { const namer = bldrbase.getNamer(args, 'vector1'); - const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], true, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], true, false]]; + const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], false, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], false, false]]; const checkedArgs = (namer !== null) ? bldrbase.makeNamedArgs(namer, 'vec.dotProduct', 2, new Set(['vector1', 'vector2']), paramdefs, args) : bldrbase.makePositionalArgs('vec.dotProduct', 2, false, paramdefs, args); @@ -5406,7 +5423,7 @@ dotProduct(...args) { */ euclideanDistance(...args) { const namer = bldrbase.getNamer(args, 'vector1'); - const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], true, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], true, false]]; + const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], false, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], false, false]]; const checkedArgs = (namer !== null) ? bldrbase.makeNamedArgs(namer, 'vec.euclideanDistance', 2, new Set(['vector1', 'vector2']), paramdefs, args) : bldrbase.makePositionalArgs('vec.euclideanDistance', 2, false, paramdefs, args); @@ -5423,7 +5440,7 @@ euclideanDistance(...args) { */ get(...args) { const namer = bldrbase.getNamer(args, 'vector1'); - const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], true, false], ['k', [types.XsUnsignedInt, PlanColumn, PlanParam], true, false]]; + const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], false, false], ['k', [types.XsUnsignedInt, PlanColumn, PlanParam], false, false]]; const checkedArgs = (namer !== null) ? bldrbase.makeNamedArgs(namer, 'vec.get', 2, new Set(['vector1', 'k']), paramdefs, args) : bldrbase.makePositionalArgs('vec.get', 2, false, paramdefs, args); @@ -5438,7 +5455,7 @@ get(...args) { * @returns { XsDouble } */ magnitude(...args) { - const paramdef = ['vector1', [types.VecVector, PlanColumn, PlanParam], true, false]; + const paramdef = ['vector1', [types.VecVector, PlanColumn, PlanParam], false, false]; const checkedArgs = bldrbase.makeSingleArgs('vec.magnitude', 1, paramdef, args); return new types.XsDouble('vec', 'magnitude', checkedArgs); } @@ -5450,7 +5467,7 @@ magnitude(...args) { * @returns { VecVector } */ normalize(...args) { - const paramdef = ['vector1', [types.VecVector, PlanColumn, PlanParam], true, false]; + const paramdef = ['vector1', [types.VecVector, PlanColumn, PlanParam], false, false]; const checkedArgs = bldrbase.makeSingleArgs('vec.normalize', 1, paramdef, args); return new types.VecVector('vec', 'normalize', checkedArgs); } @@ -5464,7 +5481,7 @@ normalize(...args) { */ subtract(...args) { const namer = bldrbase.getNamer(args, 'vector1'); - const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], true, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], true, false]]; + const paramdefs = [['vector1', [types.VecVector, PlanColumn, PlanParam], false, false], ['vector2', [types.VecVector, PlanColumn, PlanParam], false, false]]; const checkedArgs = (namer !== null) ? bldrbase.makeNamedArgs(namer, 'vec.subtract', 2, new Set(['vector1', 'vector2']), paramdefs, args) : bldrbase.makePositionalArgs('vec.subtract', 2, false, paramdefs, args); @@ -5482,7 +5499,7 @@ subtract(...args) { */ subvector(...args) { const namer = bldrbase.getNamer(args, 'vector'); - const paramdefs = [['vector', [types.VecVector, PlanColumn, PlanParam], true, false], ['start', [types.XsUnsignedInt, PlanColumn, PlanParam], true, false], ['length', [types.XsUnsignedInt, PlanColumn, PlanParam], false, false]]; + const paramdefs = [['vector', [types.VecVector, PlanColumn, PlanParam], false, false], ['start', [types.XsUnsignedInt, PlanColumn, PlanParam], false, false], ['length', [types.XsUnsignedInt, PlanColumn, PlanParam], false, false]]; const checkedArgs = (namer !== null) ? bldrbase.makeNamedArgs(namer, 'vec.subvector', 2, new Set(['vector', 'start', 'length']), paramdefs, args) : bldrbase.makePositionalArgs('vec.subvector', 2, false, paramdefs, args); @@ -5502,19 +5519,20 @@ vector(...args) { return new types.VecVector('vec', 'vector', checkedArgs); } /** - * A helper function that returns a hybrid score using a cts score and a vector similarity calculation result. You can tune the effect of the vector similarity on the score using the similarityWeight option. The ideal value for similarityWeight depends on your application. Provides a client interface to a server function. See {@link http://docs.marklogic.com/vec.vectorScore|vec.vectorScore} + * A helper function that returns a hybrid score using a cts score and a vector distance calculation result. You can tune the effect of the vector distance on the score using the distanceWeight option. The ideal value for distanceWeight depends on your application. The hybrid score is calculated using the formula: score = weight * annScore + (1 - weight) * ctsScore. - annScore is derived from the distance and distanceWeight, where a larger distanceWeight reduces the annScore for the same distance. - weight determines the contribution of the annScore and ctsScore to the final score. A weight of 0.5 balances both equally. This formula allows you to combine traditional cts scoring with vector-based distance scoring, providing a flexible way to rank results. Provides a client interface to a server function. See {@link http://docs.marklogic.com/vec.vectorScore|vec.vectorScore} * @method planBuilder.vec#vectorScore * @since 3.5.0 * @param { XsUnsignedInt } [score] - The cts:score of the matching document. - * @param { XsDouble } [similarity] - The similarity between the vector in the matching document and the query vector. The result of a call to ovec:cosine-similarity(). In the case that the vectors are normalized, pass ovec:dot-product(). Note that vec:euclidean-distance() should not be used here. - * @param { XsDouble } [similarityWeight] - The weight of the vector similarity on the score. The default value is 0.1. If 0.0 is passed in, vector similarity has no effect. If passed a value less than 0.0 or greater than 1.0, throw VEC-VECTORSCORE. + * @param { XsDouble } [distance] - The distance between the vector in the matching document and the query vector. Examples, the result of a call to ovec:cosine-distance() or ovec:euclidean-distance(). + * @param { XsDouble } [distanceWeight] - The weight of the vector distance on the annScore. This value is a positive coefficient that scales the distance. A larger distanceWeight produces a lower annScore for the same distance. The default value is 1. + * @param { XsDouble } [weight] - The weight of the annScore in the final hybrid score. This value is a coefficient between 0 and 1, where 0 gives full weight to the cts score and 1 gives full weight to the annScore. The default value is 0.5. * @returns { XsUnsignedLong } */ vectorScore(...args) { const namer = bldrbase.getNamer(args, 'score'); - const paramdefs = [['score', [types.XsUnsignedInt, PlanColumn, PlanParam], true, false], ['similarity', [types.XsDouble, PlanColumn, PlanParam], true, false], ['similarityWeight', [types.XsDouble, PlanColumn, PlanParam], false, false]]; + const paramdefs = [['score', [types.XsUnsignedInt, PlanColumn, PlanParam], false, false], ['distance', [types.XsDouble, PlanColumn, PlanParam], false, false], ['distanceWeight', [types.XsDouble, PlanColumn, PlanParam], false, false], ['weight', [types.XsDouble, PlanColumn, PlanParam], false, false]]; const checkedArgs = (namer !== null) ? - bldrbase.makeNamedArgs(namer, 'vec.vectorScore', 2, new Set(['score', 'similarity', 'similarityWeight']), paramdefs, args) : + bldrbase.makeNamedArgs(namer, 'vec.vectorScore', 2, new Set(['score', 'distance', 'distanceWeight', 'weight']), paramdefs, args) : bldrbase.makePositionalArgs('vec.vectorScore', 2, false, paramdefs, args); return new types.XsUnsignedLong('vec', 'vector-score', checkedArgs); @@ -7080,6 +7098,13 @@ class PlanFunction extends types.ServerType { super(ns, fn, args); } +} +class PlanAnnTopKOptions extends types.ServerType { + + constructor(ns, fn, args) { + super(ns, fn, args); + } + } class PlanJsonProperty extends types.ServerType { @@ -7476,28 +7501,6 @@ class PlanModifyPlan extends PlanPreparePlan { constructor(prior, ns, fn, args) { super(prior, ns, fn, args); } - - /** - * This method facilitates Approximate Nearest Neighbor vector search. It searches for K nearest neighbor vector embeddings that are stored in database given a query vector. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.annTopK|ModifyPlan.prototype.annTopK} - * @method planBuilder.ModifyPlan#annTopK - * @since 3.6.0 - * @param { XsInt } [k] - This positive integer k is the top-K rows to return as a result of the index lookup. - * @param { PlanColumn } [vectorColumn] - The column representing the vector ann-indexed column to perform the index lookup against. The columns can be named with a string or a column parameter function such as op:col. - * @param { VecVector } [queryVector] - This specifies the query vector to perform the index lookup with. - * @param { PlanColumn } [distance] - The column is the output column that returns the values of the distance metric of the vectors retrieved from the index associated with vectorColumn and the qv. The columns can be named with a string or a column parameter function such as op.col. - * @param { XsFloat } [queryTolerance] - This specifies the query tolerance to help balance recall and search time. The value is between 0.0 and 1.0. At 0.0, the recall will be highest. At 1.0 the recall will likely see a large degradation, but queries will be quick. The default value is 0.0. - * @returns { planBuilder.ModifyPlan } - */ -annTopK(...args) { - const namer = bldrbase.getNamer(args, 'k'); - const paramdefs = [['k', [types.XsInt], true, false], ['vector-column', [PlanColumn], true, false], ['query-vector', [types.VecVector], true, false], ['distance', [PlanColumn], false, false], ['query-tolerance', [types.XsFloat], false, false]]; - const checkedArgs = (namer !== null) ? - bldrbase.makeNamedArgs(namer, 'PlanModifyPlan.annTopK', 3, new Set(['k', 'vector-column', 'query-vector', 'distance', 'query-tolerance']), paramdefs, args) : - bldrbase.makePositionalArgs('PlanModifyPlan.annTopK', 3, false, paramdefs, args); - return new PlanModifyPlan(this, 'op', 'ann-top-k', checkedArgs); - - } - /** * This function adds new columns or modifies existing columns based on expressions while preserving existing unmodified columns in the row set. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.bind|ModifyPlan.prototype.bind} * @method planBuilder.ModifyPlan#bind @@ -7544,8 +7547,8 @@ except(...args) { * @method planBuilder.ModifyPlan#existsJoin * @since 2.1.1 * @param { PlanModifyPlan } [right] - The row set from the right view. - * @param { PlanJoinKey } [keys] - The equijoin from one or more calls to the op:on function. - * @param { XsBoolean } [condition] - A boolean expression that filters the join output rows. + * @param { PlanJoinKey } [keys] - Equality condition(s) expressed using one or more calls to the function op:on. These conditions are used to compare the left and right rows. + * @param { XsBoolean } [condition] - A boolean expression used to compare the left and right rows. See Boolean Expression Functions for the list of functions used to build boolean expressions. * @returns { planBuilder.ModifyPlan } */ existsJoin(...args) { @@ -7561,8 +7564,8 @@ existsJoin(...args) { * This method counts values for multiple grouping key columns. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.facetBy|ModifyPlan.prototype.facetBy} * @method planBuilder.ModifyPlan#facetBy * @since 2.1.1 - * @param { PlanNamedGroupingKey } [keys] - This parameter specifies the list of column keys for performing counts. For each column, the operation determines the unique values of that column and produces a separate count for the rows with that value. A column can be named with a string or a column parameter function such as op:col or constructed from an expression with the op:as function. The facet can be named by providing a op:named-group that takes exactly one column. - * @param { PlanExprColName } [countCol] - Specifies what to count over the rows for each unique value of each key column. By default, the operation counts the rows. To count the values of a column instead, specify the column to count with this parameter. To count documents, specify a fragment id column with op:fragment-id-col. + * @param { PlanNamedGroupingKey } [keys] - This parameter specifies the list of column keys for performing counts. For each column, the operation determines the unique values of that column and produces a separate count for the rows with that value. A column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. The facet can be named by providing a op:named-group that takes exactly one column. + * @param { PlanExprColName } [countCol] - Specifies what to count over the rows for each unique value of each key column. By default, the operation counts the rows. To count the values of a column instead, specify the column to count with this parameter. To count documents, specify a fragment id column with op:fragment-id-col. * @returns { planBuilder.ModifyPlan } */ facetBy(...args) { @@ -7595,7 +7598,7 @@ groupBy(...args) { * This method performs the union of multiple group-by operations on a row set. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.groupByUnion|ModifyPlan.prototype.groupByUnion} * @method planBuilder.ModifyPlan#groupByUnion * @since 2.1.1 - * @param { PlanGroupingKey } [keys] - The sets of grouping keys. The keys for each group are specified with the op:group, op:rollup, or op:cube functions. Each group must have a unique set of keys but multiple groups can have the same key. As a convenience, a group with a single key can specify the name of the key column with a string or a column parameter function such as op:col or constructed from an expression with op:as. The rows produced by the group-by-union operation include the key columns from each group. A group can be empty to group over all of the rows in the row set. + * @param { PlanGroupingKey } [keys] - The sets of grouping keys. The keys for each group are specified with the op:group, op:rollup, or op:cube functions. Each group must have a unique set of keys but multiple groups can have the same key. As a convenience, a group with a single key can specify the name of the key column with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with op:as. The rows produced by the group-by-union operation include the key columns from each group. A group can be empty to group over all of the rows in the row set. * @param { PlanAggregateColName } [aggregates] - This parameter specifies either columns to sample or aggregate functions to apply to a column for all of the rows in the group. Sampled columns can be existing columns or new columns created by an expression specified with op:as. Often a sampled column might have a constant value within the group such as a title or label closely associated with a numeric identifier used as the grouping key. * @returns { planBuilder.ModifyPlan } */ @@ -7612,7 +7615,7 @@ groupByUnion(...args) { * This method performs multiple group-by operations on a row set and produces a single row with a column for each group having an array value whose items are the rows for the group. Each item is an object with properties for the group keys and aggregates. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.groupToArrays|ModifyPlan.prototype.groupToArrays} * @method planBuilder.ModifyPlan#groupToArrays * @since 2.1.1 - * @param { PlanNamedGroupingKey } [keys] - The sets of grouping keys. Each group is specified with the op:named-group function. Each group must have a unique set of keys but multiple groups can have the same key. As a convenience, the parameter also accepts unnamed groups with the op:group, op:rollup, or op:cube functions or (for a group with a single key) a column named with a string or a column parameter function such as op:col or constructed from an expression with the op:as function. The row objects produced by the group-to-arrays operation include the key columns from each group. A group can be empty to group over all of the rows in the row set. + * @param { PlanNamedGroupingKey } [keys] - The sets of grouping keys. Each group is specified with the op:named-group function. Each group must have a unique set of keys but multiple groups can have the same key. As a convenience, the parameter also accepts unnamed groups with the op:group, op:rollup, or op:cube functions or (for a group with a single key) a column named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. The row objects produced by the group-to-arrays operation include the key columns from each group. A group can be empty to group over all of the rows in the row set. * @param { PlanAggregateColName } [aggregates] - This parameter specifies either columns to sample or aggregate functions to apply to a column for all of the rows in the group. Sampled columns can be existing columns or new columns created by an expression specified with op:as. Often a sampled column might have a constant value within the group such as a title or label closely associated with a numeric identifier used as the grouping key. * @returns { planBuilder.ModifyPlan } */ @@ -7659,7 +7662,7 @@ joinCrossProduct(...args) { * @method planBuilder.ModifyPlan#joinDoc * @since 2.1.1 * @param { PlanColumnName } [docCol] - The document column to add to the rows. This can be a string or column specifying the name of the new column that should have the document as its value. - * @param { PlanColumn } [sourceCol] - The document uri or fragment id value. This is either the output from op:fragment-id-col specifying a fragment id column or a document uri column. Joining on a fragment id is more efficient than joining on a uri column. + * @param { PlanColumn } [sourceCol] - The document uri or fragment id value. This is either the output from op:fragment-id-col specifying a fragment id column or a document uri column. The uri column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. Joining on a fragment id is more efficient than joining on a uri column. * @returns { planBuilder.ModifyPlan } */ joinDoc(...args) { @@ -7677,7 +7680,7 @@ joinDoc(...args) { * @since 3.4.0 * @param { PlanColumnName } [docCol] - The document column to add to the rows. This can be a string or a column, op:col, op:view-col or op:schema-col, specifying the name of the new column that should have the document as its value. * @param { PlanColumn } [uriCol] - The uri column to add to the rows. This can be a string or a column, op:col, op:view-col or op:schema-col, specifying the name of the new column that should have the document uri as its value. - * @param { PlanColumn } [sourceCol] - The document uri or fragment id value. This is either an op:fragment-id-col specifying a fragment id column or a document uri column as xs:string or as a column using op:col, op:view-col or op:schema-col. Joining on a fragment id is more efficient than joining on a uri column. + * @param { PlanColumn } [sourceCol] - The document uri or fragment id value. This is either an op:fragment-id-col specifying a fragment id column or a document uri column which can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. Joining on a fragment id is more efficient than joining on a uri column. * @returns { planBuilder.ModifyPlan } */ joinDocAndUri(...args) { @@ -7693,7 +7696,7 @@ joinDocAndUri(...args) { * This method adds a uri column to rows based on an existing fragment id column to identify the source document for each row. The fragmentIdCol must be an op:fragment-id-col specifying a fragment id column. If the fragment id column is null in the row, the row is dropped from the rowset. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.joinDocUri|ModifyPlan.prototype.joinDocUri} * @method planBuilder.ModifyPlan#joinDocUri * @since 2.1.1 - * @param { PlanColumnName } [uriCol] - The document uri. This is the output from op:col('uri') that specifies a document uri column. + * @param { PlanColumnName } [uriCol] - The new column which contains the document uris. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col. * @param { PlanColumn } [fragmentIdCol] - The document fragment id value. This is the output from op:fragment-id-col specifying a fragment id column. * @returns { planBuilder.ModifyPlan } */ @@ -7711,8 +7714,8 @@ joinDocUri(...args) { * @method planBuilder.ModifyPlan#joinInner * @since 2.1.1 * @param { PlanModifyPlan } [right] - The row set from the right view. - * @param { PlanJoinKey } [keys] - The equijoin from one or more calls to the op:on function. - * @param { XsBoolean } [condition] - A boolean expression that filters the join output rows. + * @param { PlanJoinKey } [keys] - Equality condition(s) expressed using one or more calls to the function op:on. These conditions are used to compare the left and right rows. + * @param { XsBoolean } [condition] - A boolean expression used to compare the left and right rows. See Boolean Expression Functions for the list of functions used to build boolean expressions. * @returns { planBuilder.ModifyPlan } */ joinInner(...args) { @@ -7729,8 +7732,8 @@ joinInner(...args) { * @method planBuilder.ModifyPlan#joinLeftOuter * @since 2.1.1 * @param { PlanModifyPlan } [right] - The row set from the right view. - * @param { PlanJoinKey } [keys] - The equijoin from one or more calls to the op:on function. - * @param { XsBoolean } [condition] - A boolean expression that filters the join output rows. + * @param { PlanJoinKey } [keys] - Equality condition(s) expressed using one or more calls to the function op:on. These conditions are used to compare the left and right rows. + * @param { XsBoolean } [condition] - A boolean expression used to compare the left and right rows. See Boolean Expression Functions for the list of functions used to build boolean expressions. * @returns { planBuilder.ModifyPlan } */ joinLeftOuter(...args) { @@ -7747,8 +7750,8 @@ joinLeftOuter(...args) { * @method planBuilder.ModifyPlan#joinFullOuter * @since 2.1.1 * @param { PlanModifyPlan } [right] - The row set from the right view. - * @param { PlanJoinKey } [keys] - The equijoin from one or more calls to the op:on function. - * @param { XsBoolean } [condition] - A boolean expression that filters the join output rows. + * @param { PlanJoinKey } [keys] - Equality condition(s) expressed using one or more calls to the function op:on. These conditions are used to compare the left and right rows. + * @param { XsBoolean } [condition] - A boolean expression used to compare the left and right rows. See Boolean Expression Functions for the list of functions used to build boolean expressions. * @returns { planBuilder.ModifyPlan } */ joinFullOuter(...args) { @@ -7806,8 +7809,8 @@ offsetLimit(...args) { * @method planBuilder.ModifyPlan#notExistsJoin * @since 2.1.1 * @param { PlanModifyPlan } [right] - The row set from the right view. - * @param { PlanJoinKey } [keys] - The equijoin from one or more calls to the op:on function. - * @param { XsBoolean } [condition] - A boolean expression that filters the join output rows. + * @param { PlanJoinKey } [keys] - Equality condition(s) expressed using one or more calls to the function op:on. These conditions are used to compare the left and right rows. + * @param { XsBoolean } [condition] - A boolean expression used to compare the left and right rows. See Boolean Expression Functions for the list of functions used to build boolean expressions. * @returns { planBuilder.ModifyPlan } */ notExistsJoin(...args) { @@ -7823,7 +7826,7 @@ notExistsJoin(...args) { * This method sorts the row set by the specified order definition. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.orderBy|ModifyPlan.prototype.orderBy} * @method planBuilder.ModifyPlan#orderBy * @since 2.1.1 - * @param { PlanSortKeyName } [keys] - The specified column or sortdef output from the op:asc or op:desc function. + * @param { PlanSortKeyName } [keys] - The specified column or sortdef output from the op:asc or op:desc function. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @returns { planBuilder.ModifyPlan } */ orderBy(...args) { @@ -7881,7 +7884,7 @@ prepare(...args) { * This call projects the specified columns from the current row set and / or applies a qualifier to the columns in the row set. Unlike SQL, a select call is not required in an Optic query. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.select|ModifyPlan.prototype.select} * @method planBuilder.ModifyPlan#select * @since 2.1.1 - * @param { PlanExprColName } [columns] - The columns to project from the input rows. The columns can be named with a string or a column parameter function such as op:col or constructed from an expression with op:as. + * @param { PlanExprColName } [columns] - The columns to project from the input rows. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with op:as. * @param { XsString } [qualifierName] - Specifies a name for qualifying the column names in place of the combination of the schema and view names. Use cases for the qualifier include self joins. Using an empty string removes all qualification from the column names. * @returns { planBuilder.ModifyPlan } */ @@ -7986,8 +7989,8 @@ transformDoc(...args) { * This function populates the view with the uri, doc, collections, metadata, permissions, and / or quality document descriptor columns for database document values. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.joinDocCols|ModifyPlan.prototype.joinDocCols} * @method planBuilder.ModifyPlan#joinDocCols * @since 3.1.0 - * @param { PlanDocColsIdentifier } [cols] - The source column to join. This is either an op:fragment-id-col specifying a fragment id column or a op:col, op:view-col or op:schema-col that contains document uris. Joining on a fragment id is more efficient than joining on an uri column. - * @param { PlanColumnName } [docIdCol] - The document uri or fragment id value. This is either an op.fragmentIdCol object specifying a fragment id column or a document uri column. + * @param { PlanDocColsIdentifier } [cols] - The source column to join. This is either an op:fragment-id-col specifying a fragment id column or a uri column which contains document uris. The uri column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function.Joining on a fragment id is more efficient than joining on an uri column. + * @param { PlanColumnName } [docIdCol] - The document uri or fragment id value. This is either an op.fragmentIdCol object specifying a fragment id column or a document uri column. * @returns { planBuilder.ModifyPlan } */ joinDocCols(...args) { @@ -8020,8 +8023,8 @@ validateDoc(...args) { /** * This function flattens an array value into multiple rows.Then performs a op:join-inner on the rest of the rows. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.unnestInner|ModifyPlan.prototype.unnestInner} * @method planBuilder.ModifyPlan#unnestInner - * @since 3.0.0 - * @param { PlanExprColName } [inputColumn] - The input column, which contains an array, to flatten into rows. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col if you need to identify columns in the two views that have the same column name. + * @since 3.0.0 + * @param { PlanExprColName } [inputColumn] - The input column, which contains an array, to flatten into rows. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @param { PlanExprColName } [valueColumn] - The output column which contains the flattened array values. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col as needed. * @param { PlanExprColName } [ordinalColumn] - The ordinalColumn is optional. If specified, an additional column will be added to the rows of flattened array values, starting from 1. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col as needed. * @returns { planBuilder.ModifyPlan } @@ -8038,8 +8041,8 @@ unnestInner(...args) { /** * This function flattens an array value into multiple rows.Then performs a op:join-left-outer on the rest of the rows. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.unnestLeftOuter|ModifyPlan.prototype.unnestLeftOuter} * @method planBuilder.ModifyPlan#unnestLeftOuter - * @since 3.0.0 - * @param { PlanExprColName } [inputColumn] - The input column, which contains an array, to flatten into rows. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col if you need to identify columns in the two views that have the same column name. + * @since 3.0.0 + * @param { PlanExprColName } [inputColumn] - The input column, which contains an array, to flatten into rows. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @param { PlanExprColName } [valueColumn] - The output column which contains the flattened array values. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col as needed. * @param { PlanExprColName } [ordinalColumn] - The ordinalColumn is optional. If specified, an additional column will be added to the rows of flattened array values, starting from 1. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col as needed. * @returns { planBuilder.ModifyPlan } @@ -8057,10 +8060,10 @@ unnestLeftOuter(...args) { * This method can be used to find the shortest path between two nodes in a given graph. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.shortestPath|ModifyPlan.prototype.shortestPath} * @method planBuilder.ModifyPlan#shortestPath * @since 3.6.0 - * @param { PlanExprColName } [start] - The column representing the input starting subject of the shortest path search. The columns can be named with a string or a column parameter function such as op:col. - * @param { PlanExprColName } [end] - The column representing the input ending object of the shortest path search. The columns can be named with a string or a column parameter function such as op:col. - * @param { PlanExprColName } [path] - The column is the output column representing the actual shortest path(s) taken from start to end. Values are not returned for this column if this is the empty sequence.The columns can be named with a string or a column parameter function such as op:col. - * @param { PlanExprColName } [length] - The column is the output column representing the length of the shortest path. Value is not returned for this column if this is the empty sequence.The columns can be named with a string or a column parameter function such as op:col. + * @param { PlanExprColName } [start] - The column representing the input starting subject of the shortest path search. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col. + * @param { PlanExprColName } [end] - The column representing the input ending object of the shortest path search. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col. + * @param { PlanExprColName } [path] - The column is the output column representing the actual shortest path(s) taken from start to end. Values are not returned for this column if this is the empty sequence.The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col. + * @param { PlanExprColName } [length] - The column is the output column representing the length of the shortest path. Value is not returned for this column if this is the empty sequence.The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col. * @param { PlanExprColName } [weight] - * @returns { planBuilder.ModifyPlan } */ @@ -8068,10 +8071,30 @@ shortestPath(...args) { const namer = bldrbase.getNamer(args, 'start'); const paramdefs = [['start', [PlanExprCol, PlanColumn, types.XsString], true, false], ['end', [PlanExprCol, PlanColumn, types.XsString], true, false], ['path', [PlanExprCol, PlanColumn, types.XsString], false, false], ['length', [PlanExprCol, PlanColumn, types.XsString], false, false], ['weight', [PlanExprCol, PlanColumn, types.XsString], false, false]]; const checkedArgs = (namer !== null) ? - bldrbase.makeNamedArgs(namer, 'PlanModifyPlan.shortestPath', 2, new Set(['start', 'end', 'path', 'length']), paramdefs, args) : + bldrbase.makeNamedArgs(namer, 'PlanModifyPlan.shortestPath', 2, new Set(['start', 'end', 'path', 'length', 'weight']), paramdefs, args) : bldrbase.makePositionalArgs('PlanModifyPlan.shortestPath', 2, false, paramdefs, args); return new PlanModifyPlan(this, 'op', 'shortest-path', checkedArgs); + } +/** + * This method searches against vector data, using a query vector, selecting and returning the top K nearest vectors from the column along with data associated with that vector, for examples, document, node, or row. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.annTopK|ModifyPlan.prototype.annTopK} + * @method planBuilder.ModifyPlan#annTopK + * @since 3.6.0 + * @param { PlanInputKParam } [inputK] - This positive integer k is the number of nearest neighbour results to return. + * @param { PlanExprColName } [vectorColumn] - The column is the input table to perform vector distance calculations against. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col. + * @param { PlanQueryVectorParam } [queryVector] - This is the query vector to compare with the vectors from the vector-column column. + * @param { PlanExprColName } [distanceColumn] - The column is an optional output column that returns the value of the distance metric for that output row. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col. + * @param { PlanAnnTopKOptions } [options] - This is either a sequence of strings or a map containing keys and values for the options to this operator. Options include: max-distance This option is a number determines the maximum distance for a returned result. For cosine distance, the default is float max. Rows with a distance greater than this will not be returned. search-factor This option can be used to increase or decrease the number of candidate vectors found from the index, and defaults to 1.0. Higher values will result in slower searches that may provide higher results accuracy. Lower values will result in faster searches that may give lower accuracy.distance Takes values of cosine for now, defaulting to cosine. + * @returns { planBuilder.ModifyPlan } + */ +annTopK(...args) { + const namer = bldrbase.getNamer(args, 'inputK'); + const paramdefs = [['inputK', [types.XsInteger, PlanParam], true, false], ['vectorColumn', [PlanExprCol, PlanColumn, types.XsString], true, false], ['queryVector', [PlanParam, types.VecVector], true, false], ['distanceColumn', [PlanExprCol, PlanColumn, types.XsString], false, false], ['options', [PlanAnnTopKOptions], false, false]]; + const checkedArgs = (namer !== null) ? + bldrbase.makeNamedArgs(namer, 'PlanModifyPlan.annTopK', 3, new Set(['inputK', 'vectorColumn', 'queryVector', 'distanceColumn', 'options']), paramdefs, args) : + bldrbase.makePositionalArgs('PlanModifyPlan.annTopK', 3, false, paramdefs, args); + return new PlanModifyPlan(this, 'op', 'ann-top-k', checkedArgs); + } } /** @@ -8088,7 +8111,7 @@ class PlanAccessPlan extends PlanModifyPlan { * Identifies a column where the column name is unique and a qualifier on the column name isn't necessary (and might not exist). Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.col|op.col} * @method planBuilder.AccessPlan#col * @since 2.1.1 - * @param { XsString } [column] - The Optic AccessorPlan created by op:from-view, op:from-triples, or op:from-lexicons. + * @param { XsString } [column] - The name of the column. * @returns { planBuilder.PlanColumn } */ col(...args) { @@ -8215,8 +8238,8 @@ this.xs = (fieldOverrides.xs !== void 0) ? fieldOverrides.xs : new XsExpr(); * This function returns the sum of the specified numeric expressions. In expressions, the call should pass the result from an op:col function to identify a column. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.add|op.add} * @method planBuilder#add * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left value expression. - * @param { XsAnyAtomicType } [right] - The right value expression. + * @param { XsAnyAtomicType } [left] - The left value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or expressions. + * @param { XsAnyAtomicType } [right] - The right value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or expressions. * @returns { XsNumeric } */ add(...args) { @@ -8253,8 +8276,8 @@ and(...args) { * This function divides the left numericExpression by the right numericExpression and returns the value. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.divide|op.divide} * @method planBuilder#divide * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left numeric expression. - * @param { XsAnyAtomicType } [right] - The right numeric expression. + * @param { XsAnyAtomicType } [left] - The left numeric expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or expressions. + * @param { XsAnyAtomicType } [right] - The right numeric expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or expressions. * @returns { XsNumeric } */ divide(...args) { @@ -8272,8 +8295,8 @@ divide(...args) { * This function takes two or more expressions and returns true if all of the expressions return the same value. Otherwise, it returns false. The expressions can include calls to the op:col function to get the value of a column. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.eq|op.eq} * @method planBuilder#eq * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left value expression. - * @param { XsAnyAtomicType } [right] - The right value expression. + * @param { XsAnyAtomicType } [left] - The left value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. + * @param { XsAnyAtomicType } [right] - The right value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. * @returns { XsBoolean } */ eq(...args) { @@ -8291,8 +8314,8 @@ eq(...args) { * This function returns true if the value of the left expression is greater than or equal to the value of the right expression. Otherwise, it returns false. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.ge|op.ge} * @method planBuilder#ge * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left value expression. - * @param { XsAnyAtomicType } [right] - The right value expression. + * @param { XsAnyAtomicType } [left] - The left value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. + * @param { XsAnyAtomicType } [right] - The right value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. * @returns { XsBoolean } */ ge(...args) { @@ -8310,8 +8333,8 @@ ge(...args) { * This function returns true if the value of the left expression is greater than the value of the right expression. Otherwise, it returns false. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.gt|op.gt} * @method planBuilder#gt * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left value expression. - * @param { XsAnyAtomicType } [right] - The right value expression. + * @param { XsAnyAtomicType } [left] - The left value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. + * @param { XsAnyAtomicType } [right] - The right value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. * @returns { XsBoolean } */ gt(...args) { @@ -8326,10 +8349,10 @@ gt(...args) { return new types.XsBoolean('op', 'gt', args); } /** - * This function returns true if a test expression evaluates to the same value as any of a list of candidate expressions. Otherwise, it returns false. The expressions can include calls to the op:col function to get the value of a column. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.in|op.in} + * This function returns true if a test expression evaluates to the same value as any of a list of candidate expressions. Otherwise, it returns false. The expressions can include calls to the column parameter function such as op:col function to get the value of a column. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.in|op.in} * @method planBuilder#in * @since 2.1.1 - * @param { XsAnyAtomicType } [value] - The expression providing the value to test. + * @param { XsAnyAtomicType } [value] - The expression providing the value to test. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, which contains numbers or an expression that outputs a number. * @param { XsAnyAtomicType } [anyOf] - One or more expressions providing the candidate values. * @returns { XsBoolean } */ @@ -8345,7 +8368,7 @@ in(...args) { return new types.XsBoolean('op', 'in', args); } /** - * This function tests whether the value of an expression is null in the row where the expression might be as simple as a column identified by op:col. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.isDefined|op.isDefined} + * This function tests whether the value of an expression is null in the row where the expression might be as simple as a column identified by column parameter function , such as op:col. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.isDefined|op.isDefined} * @method planBuilder#isDefined * @since 2.1.1 * @param { Item } [operand] - A boolean expression, such as op:eq or op:not, that might be null. @@ -8360,8 +8383,8 @@ isDefined(...args) { * This function returns true if the value of the left expression is less than or equal to the value of the right expression. Otherwise, it returns false. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.le|op.le} * @method planBuilder#le * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left value expression. - * @param { XsAnyAtomicType } [right] - The right value expression. + * @param { XsAnyAtomicType } [left] - The left value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. + * @param { XsAnyAtomicType } [right] - The right value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. * @returns { XsBoolean } */ le(...args) { @@ -8379,8 +8402,8 @@ le(...args) { * This function returns true if the value of the left expression is less than the value of the right expression. Otherwise, it returns false. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.lt|op.lt} * @method planBuilder#lt * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left value expression. - * @param { XsAnyAtomicType } [right] - The right value expression. + * @param { XsAnyAtomicType } [left] - The left value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. + * @param { XsAnyAtomicType } [right] - The right value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. * @returns { XsBoolean } */ lt(...args) { @@ -8398,8 +8421,8 @@ lt(...args) { * This function multiplies the left numericExpression by the right numericExpression and returns the value. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.multiply|op.multiply} * @method planBuilder#multiply * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left numeric expression. - * @param { XsAnyAtomicType } [right] - The right numeric expression. + * @param { XsAnyAtomicType } [left] - The left numeric expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or expressions. + * @param { XsAnyAtomicType } [right] - The right numeric expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or expressions. * @returns { XsNumeric } */ multiply(...args) { @@ -8417,8 +8440,8 @@ multiply(...args) { * This function returns true if the value of the left expression is not equal to the value of the right expression. Otherwise, it returns false. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.ne|op.ne} * @method planBuilder#ne * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left value expression. - * @param { XsAnyAtomicType } [right] - The right value expression. + * @param { XsAnyAtomicType } [left] - The left value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or expressions. + * @param { XsAnyAtomicType } [right] - The right value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or expressions. * @returns { XsBoolean } */ ne(...args) { @@ -8445,10 +8468,10 @@ not(...args) { return new types.XsBoolean('op', 'not', args); } /** - * This function returns true if the specified expressions all return true. Otherwise, it returns false. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.or|op.or} + * This function returns true if any of the specified boolean expressions return true. Otherwise, it returns false. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.or|op.or} * @method planBuilder#or * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left value expression. + * @param { XsAnyAtomicType } [left] - The left value expression. See Boolean Expression Functions for the list of functions used to build boolean expressions. * @param { XsAnyAtomicType } [right] - The right value expression. * @returns { XsBoolean } */ @@ -8467,8 +8490,8 @@ or(...args) { * This function subtracts the right numericExpression from the left numericExpression and returns the value. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.subtract|op.subtract} * @method planBuilder#subtract * @since 2.1.1 - * @param { XsAnyAtomicType } [left] - The left numeric expression. - * @param { XsAnyAtomicType } [right] - The right numeric expression. + * @param { XsAnyAtomicType } [left] - The left numeric expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. + * @param { XsAnyAtomicType } [right] - The right numeric expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. * @returns { XsNumeric } */ subtract(...args) { @@ -8514,7 +8537,7 @@ param(...args) { * Identifies a column where the column name is unique and a qualifier on the column name isn't necessary (and might not exist). Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.col|op.col} * @method planBuilder#col * @since 2.1.1 - * @param { XsString } [column] - The Optic AccessorPlan created by op:from-view, op:from-triples, or op:from-lexicons. + * @param { XsString } [column] - The name of the column. * @returns { planBuilder.PlanColumn } */ col(...args) { @@ -8652,9 +8675,9 @@ fromTriples(...args) { * This function builds the parameters for the op:from-triples function. The result is passed to op:from-triples to project rows from the graph of triples. The columns in a pattern become the columns of the row. The literals in a pattern are used to match triples. You should specify at least one literal in each pattern, usually the predicate. Where a column appears in more than one pattern, the matched triples are joined to form the row. You can specify optional triples with a op:join-left-outer with a separate op:from-triples. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.pattern|op.pattern} * @method planBuilder#pattern * @since 2.1.1 - * @param { PlanTriplePosition } [subjects] - One column or one or more literal values, such as the literal returned by a sem:iri call. - * @param { PlanTriplePosition } [predicates] - One column or one or more literal values, such as the literal returned by a sem.iri call. - * @param { PlanTriplePosition } [objects] - One column or one or more literal values, such as the literal returned by a sem:iri call. + * @param { PlanTriplePosition } [subjects] - One column or one or more literal values, such as the literal returned by a sem:iri call. The column can be named with a column function such as op:col, op:view-col, or op:schema-col. + * @param { PlanTriplePosition } [predicates] - One column or one or more literal values, such as the literal returned by a sem.iri call. The column can be named with a column function such as op:col, op:view-col, or op:schema-col. + * @param { PlanTriplePosition } [objects] - One column or one or more literal values, such as the literal returned by a sem:iri call. The column can be named with a column function such as op:col, op:view-col, or op:schema-col. * @param { PlanSystemColumn } [sysCols] - Specifies the result of an op:fragment-id-col or op:graph-col function to add columns for the fragment id or graph iri. * @returns { planBuilder.PlanTriplePattern } */ @@ -8743,7 +8766,7 @@ fromSQL(...args) { * @since 2.1.1 * @param { PlanSearchQuery } [query] - Qualifies and establishes the scores for a set of documents. The query can be a cts:query or a string as a shortcut for a cts:word-query. * @param { XsString } [qualifierName] - Specifies a name for qualifying the column names. - * @param { PlanSearchOption } [option] - Similar to the options of cts:search, supplies the 'scoreMethod' key with a value of 'logtfidf', 'logtf', 'simple', 'zero', 'random', or 'bm25' to specify the method for assigning a score to matched documents or supplies the 'qualityWeight' key with a numeric value to specify a multiplier for the quality contribution to the score. Specify a value between 0 (exclusive) and 1 (inclusive) for bm25LengthWeight if 'bm25' scoring method is used. + * @param { PlanSearchOption } [option] - Similar to the options of cts:search, supplies the 'scoreMethod' key with a value of 'logtfidf', 'logtf', 'simple', 'zero', 'random', or 'bm25' to specify the method for assigning a score to matched documents or supplies the 'qualityWeight' key with a numeric value to specify a multiplier for the quality contribution to the score. 'logtfidf' is the default score method and the results are ordered by score by default. Specify a value between 0 (exclusive) and 1 (inclusive) for bm25LengthWeight if 'bm25' scoring method is used. * @returns { planBuilder.AccessPlan } */ fromSearchDocs(...args) { @@ -8842,8 +8865,8 @@ sqlCondition(...args) { * Specifies an equijoin using one columndef each from the left and right rows. The result is used by the op:join-inner, op:join-left-outer, and op:join-full-outer, and functions. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.on|op.on} * @method planBuilder#on * @since 2.1.1 - * @param { PlanExprColName } [left] - The rows from the left view. - * @param { PlanExprColName } [right] - The row set from the right view. + * @param { PlanExprColName } [left] - The rows from the left view. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. + * @param { PlanExprColName } [right] - The row set from the right view. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @returns { planBuilder.PlanJoinKey } */ on(...args) { @@ -8859,7 +8882,7 @@ on(...args) { * This function specifies the grouping keys for a group as a list of zero or more columns. The result is used for building the first parameter for the op:group-by-union function. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.group|op.group} * @method planBuilder#group * @since 2.1.1 - * @param { PlanExprColName } [keys] - The columns (if any) to use as grouping keys. The columns can be named with a string or a column parameter function such as op:col or constructed from an expression with op:as. + * @param { PlanExprColName } [keys] - The columns (if any) to use as grouping keys. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with op:as. * @returns { planBuilder.PlanGroup } */ group(...args) { @@ -8871,7 +8894,7 @@ group(...args) { * This function specifies a list of grouping keys for a group and returns that group and larger groups (including all rows) formed by dropping columns from right to left. The result is used for building the first parameter for the op:group-by-union or op:group-to-arrays functions. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.rollup|op.rollup} * @method planBuilder#rollup * @since 2.1.1 - * @param { PlanExprColName } [keys] - The columns to use as grouping keys. The columns can be named with a string or a column parameter function such as op:col or constructed from an expression with op:as. + * @param { PlanExprColName } [keys] - The columns to use as grouping keys. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with op:as. * @returns { planBuilder.PlanGroup } */ rollup(...args) { @@ -8883,7 +8906,7 @@ rollup(...args) { * This function specifies a list of grouping keys for a group and returns that group and every possible larger group (including all rows) formed from any subset of keys. The result is used for building the first parameter for the op:group-by-union or op:group-to-arrays functions. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.cube|op.cube} * @method planBuilder#cube * @since 2.1.1 - * @param { PlanExprColName } [keys] - The columns to use as grouping keys. The columns can be named with a string or a column parameter function such as op:col or constructed from an expression with op:as. + * @param { PlanExprColName } [keys] - The columns to use as grouping keys. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with op:as. * @returns { planBuilder.PlanGroup } */ cube(...args) { @@ -8896,7 +8919,7 @@ cube(...args) { * @method planBuilder#namedGroup * @since 2.1.1 * @param { XsString } [name] - The name for the list of grouping keys. - * @param { PlanExprColName } [keys] - The columns (if any) to use as grouping keys. The columns can be named with a string or a column parameter function such as op:col or constructed from an expression with op:as. + * @param { PlanExprColName } [keys] - The columns (if any) to use as grouping keys. The columns can be named with a string or a a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with op:as. * @returns { planBuilder.PlanNamedGroup } */ namedGroup(...args) { @@ -8913,7 +8936,7 @@ namedGroup(...args) { * @method planBuilder#bucketGroup * @since 2.1.1 * @param { XsString } [name] - The name of both the group and the new grouping key column with numbered buckets. - * @param { PlanExprColName } [key] - The identifier for the existing column with the values (typically numeric or datetime) to put into buckets. The columns can be named with a string or a column parameter function such as op:col or constructed from an expression with op:as. + * @param { PlanExprColName } [key] - The identifier for the existing column with the values (typically numeric or datetime) to put into buckets. The columns can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with op:as. * @param { XsAnyAtomicType } [boundaries] - An ordered XQuery sequence of values that specify the boundaries between buckets. The values must have the same type as the existing column. * @param { XsString } [collation] - The collation to use when comparing strings as described in 'Collation URI Syntax' in the Application Developer's Guide * @returns { planBuilder.PlanNamedGroup } @@ -8932,8 +8955,8 @@ bucketGroup(...args) { * @method planBuilder#avg * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the aggregated column. - * @param { PlanExprColName } [column] - The column to be aggregated. - * @param { PlanValueOption } [option] - The options can take a values key with a distinct value to average the distinct values of the column. + * @param { PlanExprColName } [column] - The column to be aggregated. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. + * @param { PlanValueOption } [option] - The options can take a values key with a 'distinct' value to average the distinct values of the column. * @returns { planBuilder.PlanAggregateCol } */ avg(...args) { @@ -8950,8 +8973,8 @@ avg(...args) { * @method planBuilder#arrayAggregate * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the aggregated column. - * @param { PlanExprColName } [column] - The columns to be aggregated. - * @param { PlanValueOption } [option] - The options can take a values key with a distinct value to average the distinct values of the column. + * @param { PlanExprColName } [column] - The columns to be aggregated. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. + * @param { PlanValueOption } [option] - The options can take a values key with a 'distinct' value to aggregate the distinct values of the column. * @returns { planBuilder.PlanAggregateCol } */ arrayAggregate(...args) { @@ -8968,7 +8991,7 @@ arrayAggregate(...args) { * @method planBuilder#count * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the column values. - * @param { PlanExprColName } [column] - The columns to be counted. + * @param { PlanExprColName } [column] - The columns to be counted. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @param { PlanValueOption } [option] - The options can take a values key with a 'distinct' value to count the distinct values of the column. * @returns { planBuilder.PlanAggregateCol } */ @@ -8986,8 +9009,8 @@ count(...args) { * @method planBuilder#groupConcat * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for column with the concatenated values. - * @param { PlanExprColName } [column] - The name of the column with the values to be concatenated for the group. - * @param { PlanGroupConcatString } [options] - The options can take a values key with a distinct value to average the distinct values of the column. In addition to the values key, the options can take a separator key specifying a separator character. The value can be a string or placeholder parameter. + * @param { PlanExprColName } [column] - The name of the column with the values to be concatenated for the group. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. + * @param { PlanGroupConcatString } [options] - The options can take a values key with a 'distinct' value to concat the distinct values of the column. In addition to the values key, the options can take a separator key specifying a separator character. The value can be a string or placeholder parameter. * @returns { planBuilder.PlanAggregateCol } */ groupConcat(...args) { @@ -9021,7 +9044,7 @@ groupKey(...args) { * @method planBuilder#hasGroupKey * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the aggregated flag column. - * @param { PlanExprColName } [column] - The column to flag as a grouping key. The column can be named with a string or a column parameter function such as op:col or constructed from an expression with op:as. + * @param { PlanExprColName } [column] - The column to flag as a grouping key. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with op:as. * @returns { planBuilder.PlanAggregateCol } */ hasGroupKey(...args) { @@ -9038,7 +9061,7 @@ hasGroupKey(...args) { * @method planBuilder#max * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the largest value. - * @param { PlanExprColName } [column] - The group or row set. + * @param { PlanExprColName } [column] - The column to be aggregated. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @param { PlanValueOption } [option] - The options can take a values key with a distinct value to average the distinct values of the column. * @returns { planBuilder.PlanAggregateCol } */ @@ -9056,7 +9079,7 @@ max(...args) { * @method planBuilder#min * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the smallest value. - * @param { PlanExprColName } [column] - The group or row set. + * @param { PlanExprColName } [column] - The column to be aggregated. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @param { PlanValueOption } [option] - The options can take a values key with a distinct value to average the distinct values of the column. * @returns { planBuilder.PlanAggregateCol } */ @@ -9074,7 +9097,7 @@ min(...args) { * @method planBuilder#sample * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the value. - * @param { PlanExprColName } [column] - The group or row set. + * @param { PlanExprColName } [column] - The column to be aggregated. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @returns { planBuilder.PlanAggregateCol } */ sample(...args) { @@ -9091,8 +9114,8 @@ sample(...args) { * @method planBuilder#sequenceAggregate * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the aggregated column. - * @param { PlanExprColName } [column] - The column with the values to aggregate. - * @param { PlanValueOption } [option] - The options can take a values key with a distinct value to average the distinct values of the column. + * @param { PlanExprColName } [column] - The column to be aggregated. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. + * @param { PlanValueOption } [option] - The options can take a values key with a 'distinct' value to aggregate the distinct values of the column. * @returns { planBuilder.PlanAggregateCol } */ sequenceAggregate(...args) { @@ -9109,8 +9132,8 @@ sequenceAggregate(...args) { * @method planBuilder#sum * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the aggregated column. - * @param { PlanExprColName } [column] - The column with the values to add. - * @param { PlanValueOption } [option] - The options can take a values key with a distinct value to average the distinct values of the column. + * @param { PlanExprColName } [column] - The column with the values to add. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. + * @param { PlanValueOption } [option] - The options can take a values key with a 'distinct' value to sum the distinct values of the column. * @returns { planBuilder.PlanAggregateCol } */ sum(...args) { @@ -9127,10 +9150,10 @@ sum(...args) { * @method planBuilder#uda * @since 2.1.1 * @param { PlanColumnName } [name] - The name to be used for the aggregated column. - * @param { PlanExprColName } [column] - The column with the values to aggregate. + * @param { PlanExprColName } [column] - The column to be aggregated. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @param { XsString } [module] - The path to the installed plugin module. * @param { XsString } [function] - The name of the UDF function. - * @param { XsAnyAtomicType } [arg] - The options can take a values key with a distinct value to average the distinct values of the column and an arg key specifying an argument for the user-defined aggregate. The value can be a string or placeholder parameter. + * @param { XsAnyAtomicType } [arg] - The options can take a values key with a 'distinct' value to aggregate the distinct values of the column and an arg key specifying an argument for the user-defined aggregate. The value can be a string or placeholder parameter. * @returns { planBuilder.PlanAggregateCol } */ uda(...args) { @@ -9146,7 +9169,7 @@ uda(...args) { * This function sorts the rows by the values of the specified column in ascending order. The results are used by the op:order-by function. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.asc|op.asc} * @method planBuilder#asc * @since 2.1.1 - * @param { PlanExprColName } [column] - The column by which order the output. + * @param { PlanExprColName } [column] - The column to order the output. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @returns { planBuilder.PlanSortKey } */ asc(...args) { @@ -9158,7 +9181,7 @@ asc(...args) { * This function sorts the rows by the values of the specified column in descending order. The results are used by the op:order-by function. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.desc|op.desc} * @method planBuilder#desc * @since 2.1.1 - * @param { PlanExprColName } [column] - The column by which order the output. + * @param { PlanExprColName } [column] - The column to order the output. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @returns { planBuilder.PlanSortKey } */ desc(...args) { @@ -9221,7 +9244,7 @@ when(...args) { * This function extracts a sequence of child nodes from a column with node values -- especially, the document nodes from a document join. The path is an XPath (specified as a string) to apply to each node to generate a sequence of nodes as an expression value. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.xpath|op.xpath} * @method planBuilder#xpath * @since 2.1.1 - * @param { PlanColumnName } [column] - The name of the column from which to extract the child nodes. + * @param { PlanColumnName } [column] - The name of the column from which to extract the child nodes. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function. * @param { XsString } [path] - An XPath (specified as a string) to apply to each node. * @param { PlanNamespaceBindings } [namespaceBindings] - A map of namespace bindings. The keys should be namespace prefixes and the values should be namespace URIs. These namespace bindings will be added to the in-scope namespace bindings in the evaluation of the path. * @returns { Node } diff --git a/lib/server-types-generated.js b/lib/server-types-generated.js index 64700508..8d9ab62f 100755 --- a/lib/server-types-generated.js +++ b/lib/server-types-generated.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 MarkLogic Corporation + * Copyright (c) 2003-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +44,13 @@ class SqlRowID extends ServerType { super(ns, fn, args); } +} +class ServerNode extends ServerType { + + constructor(ns, fn, args) { + super(ns, fn, args); + } + } class SemBlank extends ServerType { @@ -708,6 +715,7 @@ class XsUnsignedByte extends XsUnsignedShort { module.exports = { ServerType: ServerType, +ServerNode: ServerNode, ArrayNode: ArrayNode, AttributeNode: AttributeNode, BooleanNode: BooleanNode, diff --git a/test-basic/optic-vector.js b/test-basic/optic-vector.js index e1c4d158..5bdfcc7e 100644 --- a/test-basic/optic-vector.js +++ b/test-basic/optic-vector.js @@ -28,7 +28,7 @@ const testlib = require("../etc/test-lib"); let serverConfiguration = {}; const testPlan = pbb.testPlan; -describe('tests for new vector fucntions.', function() { +describe('tests for new vector functions.', function() { before(function (done) { this.timeout(6000); try { @@ -81,16 +81,16 @@ describe('tests for new vector fucntions.', function() { const vec1 = p.vec.vector([0.002]); testPlan([""],p.vec.base64Encode(p.vec.subvector(vec1,0))) .then(function(response) { - assert(response.rows[0].t.value =='FYT6NiFJhGw=AQAAAA==AAAAAA==bxIDOw==') + assert(response.rows[0].t.value =='AAAAAAEAAABvEgM7') done(); }).catch(error => done(error)); }); - it('vec.cosineSimilarity', function(done) { + it('vec.cosine', function(done) { const vec1 = p.vec.vector([1, 2, 3]) const vec2 = p.vec.vector([4, 5, 6,7]) - testPlan([""],p.vec.cosineSimilarity(p.vec.subvector(vec1,0),p.vec.subvector(vec2,1))) + testPlan([""],p.vec.cosine(p.vec.subvector(vec1,0),p.vec.subvector(vec2,1))) .then(function(response) { assert(response.rows[0].t.value != null); done(); @@ -110,7 +110,7 @@ describe('tests for new vector fucntions.', function() { const vec1 = p.vec.vector([1, 2, 3]) const vec2 = p.vec.vector([4, 5, 6,7]) - testPlan([""],p.vec.cosineSimilarity(p.vec.subvector(vec1,0),p.vec.subvector(vec2,1))) + testPlan([""],p.vec.cosine(p.vec.subvector(vec1,0),p.vec.subvector(vec2,1))) .then(function(response) { assert(response.rows[0].t.value == '0.968329608440399'); done(); @@ -159,7 +159,16 @@ describe('tests for new vector fucntions.', function() { const vec1 = p.vec.vector([1, 2, 3]) testPlan([""],(p.vec.vectorScore(24684,0.1,0.1))) .then(function(response) { - assert(response.rows[0].t.value == 24687); + assert(response.rows[0].t.value == 113124); + done(); + }).catch(error => done(error)); + }); + + it('vec.cosineDistance', function(done) { + testPlan([""],(p.vec.cosineDistance(p.vec.subvector(p.vec.vector([1, 2, 3]),0), + p.vec.subvector(p.vec.vector([4, 5, 6,7]),1)))) + .then(function(response) { + assert(response.rows[0].t.value == 0.0316703915596008); done(); }).catch(error => done(error)); }); diff --git a/test-basic/plan-builder-generated.js b/test-basic/plan-builder-generated.js index bfb2d8b5..a8de882e 100755 --- a/test-basic/plan-builder-generated.js +++ b/test-basic/plan-builder-generated.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 MarkLogic Corporation + * Copyright (c) 2003-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1741,7 +1741,7 @@ describe('plan builder', function() { } testPlan([p.xs.string("abc")], p.vec.base64Decode(p.col("1"))) .then(function(response) { - should(String(getResult(response).value).replace(/^ /, '')).equal("abc"); + should(String(getResult(response).value).replace(/^ /, '')).equal('abc'); done(); }).catch(done); }); @@ -1749,11 +1749,9 @@ describe('plan builder', function() { if(serverConfiguration.serverVersion < 12) { this.skip(); } - // Updating below test since server throws Error : VEC-VECTORSCORE: vec:vector-score(1, 2) -- - // Invalid argument passed to vector scoring function: arg2 invalid: Similarity must be between -1.0 and 1.0 - testPlan([p.xs.unsignedInt(1), p.xs.double(1.2)], p.vec.vectorScore(p.col("1"), 0.75)) + testPlan([p.xs.unsignedInt(1), p.xs.double(1.2)], p.vec.vectorScore(p.col("1"), p.col("2"))) .then(function(response) { - should(String(getResult(response).value).replace(/^ /, '')).equal('1'); + should(String(getResult(response).value).replace(/^ /, '')).equal('227273'); done(); }).catch(done); }); @@ -1761,11 +1759,16 @@ describe('plan builder', function() { if(serverConfiguration.serverVersion < 12) { this.skip(); } - // Updating below test since server throws Error :arg2 invalid:Similarity must be between -1.0 and 1.0 - //arg3 invalid: Similarity weight must be between 0.0 and 1.0 - testPlan([p.xs.unsignedInt(1), p.xs.double(1.2), p.xs.double(1.2)], p.vec.vectorScore(p.col("1"), 0.75, 0.75)) + testPlan([p.xs.unsignedInt(1), p.xs.double(1.2), p.xs.double(1.2)], p.vec.vectorScore(p.col("1"), p.col("2"), p.col("3"))) .then(function(response) { - should(String(getResult(response).value).replace(/^ /, '')).equal('2'); + should(String(getResult(response).value).replace(/^ /, '')).equal(null); + done(); + }).catch(done); + }); + it('vec.vectorScore#4', function(done) { + testPlan([p.xs.unsignedInt(1), p.xs.double(1.2), p.xs.double(1.2), p.xs.double(1.2)], p.vec.vectorScore(p.col("1"), p.col("2"), p.col("3"), p.col("4"))) + .then(function(response) { + should(String(getResult(response).value).replace(/^ /, '')).equal(null); done(); }).catch(done); });