Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

FindNearest

import type { FindNearest } from "https://googleapis.deno.dev/v1/datastore:v1.ts";

Nearest Neighbors search config. The ordering provided by FindNearest supersedes the order_by stage. If multiple documents have the same vector distance, the returned document order is not guaranteed to be stable between queries.

interface FindNearest {
distanceMeasure?:
| "DISTANCE_MEASURE_UNSPECIFIED"
| "EUCLIDEAN"
| "COSINE"
| "DOT_PRODUCT";
distanceResultProperty?: string;
distanceThreshold?: number;
limit?: number;
queryVector?: Value;
vectorProperty?: PropertyReference;
}

§Properties

§
distanceMeasure?: "DISTANCE_MEASURE_UNSPECIFIED" | "EUCLIDEAN" | "COSINE" | "DOT_PRODUCT"
[src]

Required. The Distance Measure to use, required.

§
distanceResultProperty?: string
[src]

Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to entity property limitations.

§
distanceThreshold?: number
[src]

Optional. Option to specify a threshold for which no less similar documents will be returned. The behavior of the specified distance_measure will affect the meaning of the distance threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the comparison is inverted. * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold * For DOT_PRODUCT: WHERE distance >= distance_threshold

§
limit?: number
[src]

Required. The number of nearest neighbors to return. Must be a positive integer of no more than 100.

§
queryVector?: Value
[src]

Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.

§
vectorProperty?: PropertyReference
[src]

Required. An indexed vector property to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.