UNPKG

@neo4j/cypher-builder

Version:

A programmatic API for building Cypher queries for Neo4j

27 lines (26 loc) 1.14 kB
"use strict"; /* * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] */ Object.defineProperty(exports, "__esModule", { value: true }); exports.euclidean = euclidean; exports.cosine = cosine; const CypherFunctions_1 = require("../../expressions/functions/CypherFunctions"); const VECTOR_SIMILARITY_NAMESPACE = "vector.similarity"; /** Returns a FLOAT representing the similarity between the argument vectors based on their Euclidean distance. * @see [Neo4j Documentation](https://neo4j.com/docs/cypher-manual/current/functions/vector/#functions-similarity-euclidean) * @group Functions * @since Neo4j 5.18 */ function euclidean(a, b) { return new CypherFunctions_1.CypherFunction("euclidean", [a, b], VECTOR_SIMILARITY_NAMESPACE); } /** Returns a FLOAT representing the similarity between the argument vectors based on their cosine. * @see [Neo4j Documentation](https://neo4j.com/docs/cypher-manual/current/functions/vector/#functions-similarity-cosine) * @group Functions * @since Neo4j 5.18 */ function cosine(a, b) { return new CypherFunctions_1.CypherFunction("cosine", [a, b], VECTOR_SIMILARITY_NAMESPACE); }