|
15 | 15 | */ |
16 | 16 | 'use strict'; |
17 | 17 |
|
18 | | -/* IMPORTANT: Do not edit. This file is generated. */ |
| 18 | +/* |
| 19 | +The contents of this file are mostly an output of the Optic code generator. |
| 20 | +But some parts have been manually modified. So care needs to be taken when |
| 21 | +running the code generator to not lose any manual modifications, each of |
| 22 | +which should either be commented or should be obvious, such as changes in |
| 23 | +version numbers for "since" annotations. |
| 24 | +*/ |
19 | 25 |
|
20 | 26 | const types = require('./server-types-generated.js'); |
21 | 27 | const bldrbase = require('./plan-builder-base.js'); |
@@ -7470,6 +7476,28 @@ class PlanModifyPlan extends PlanPreparePlan { |
7470 | 7476 | constructor(prior, ns, fn, args) { |
7471 | 7477 | super(prior, ns, fn, args); |
7472 | 7478 | } |
| 7479 | + |
| 7480 | + /** |
| 7481 | + * 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} |
| 7482 | + * @method planBuilder.ModifyPlan#annTopK |
| 7483 | + * @since 3.6.0 |
| 7484 | + * @param { XsInt } [k] - This positive integer k is the top-K rows to return as a result of the index lookup. |
| 7485 | + * @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. |
| 7486 | + * @param { VecVector } [queryVector] - This specifies the query vector to perform the index lookup with. |
| 7487 | + * @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. |
| 7488 | + * @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. |
| 7489 | + * @returns { planBuilder.ModifyPlan } |
| 7490 | + */ |
| 7491 | +annTopK(...args) { |
| 7492 | + const namer = bldrbase.getNamer(args, 'k'); |
| 7493 | + 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]]; |
| 7494 | + const checkedArgs = (namer !== null) ? |
| 7495 | + bldrbase.makeNamedArgs(namer, 'PlanModifyPlan.annTopK', 3, new Set(['k', 'vector-column', 'query-vector', 'distance', 'query-tolerance']), paramdefs, args) : |
| 7496 | + bldrbase.makePositionalArgs('PlanModifyPlan.annTopK', 3, false, paramdefs, args); |
| 7497 | + return new PlanModifyPlan(this, 'op', 'ann-top-k', checkedArgs); |
| 7498 | + |
| 7499 | + } |
| 7500 | + |
7473 | 7501 | /** |
7474 | 7502 | * 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} |
7475 | 7503 | * @method planBuilder.ModifyPlan#bind |
|
0 commit comments