mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 19:59:54 -05:00
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Refactoring ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Clean up dead vector code - the score calculation is now embedded in the document. ---- #### AI description (iteration 1) #### PR Classification Code cleanup #### PR Summary This pull request removes dead vector code from the project, simplifying the codebase and improving maintainability. - Removed `CreateFCInfoForScoreCalculation` and related logic from `src/vector/vector_utilities.c`. - Deleted `SearchQueryEvalDataWorker` struct and associated functions from `include/vector/vector_utilities.h`. - Cleaned up vector search data handling in `src/customscan/custom_query_scan.c`. - Removed vector search query data extraction logic from `src/opclass/index_support.c`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
51 lines
1.3 KiB
C
51 lines
1.3 KiB
C
/*-------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
*
|
|
* include/vector/vector_utilities.h
|
|
*
|
|
* Utility functions for computing vector scores
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef VECTOR_UTILITIES__H
|
|
#define VECTOR_UTILITIES__H
|
|
|
|
#include <io/bson_core.h>
|
|
#include <fmgr.h>
|
|
|
|
#include "vector/vector_spec.h"
|
|
|
|
|
|
/*
|
|
* Type that holds data needed for
|
|
* computing scores vector returned from
|
|
* a vector search query. This is used to
|
|
* move required data across nodes via
|
|
* CustomScan.
|
|
*/
|
|
typedef struct SearchQueryEvalData
|
|
{
|
|
/* This contains the bson value of the search parameter,
|
|
* like { "nProbes": 4 } */
|
|
Datum SearchParamBson;
|
|
|
|
/* The access method oid of the vector index
|
|
* ivfflat/hnsw */
|
|
Oid VectorAccessMethodOid;
|
|
} SearchQueryEvalData;
|
|
|
|
|
|
double EvaluateMetaSearchScore(pgbson *document);
|
|
|
|
char * GenerateVectorIndexExprStr(const char *keyPath,
|
|
const CosmosSearchOptions *searchOptions);
|
|
|
|
Expr * GenerateVectorSortExpr(const char *queryVectorPath,
|
|
FuncExpr *vectorCastFunc, Relation indexRelation,
|
|
Node *documentExpr, Node *vectorQuerySpecNode);
|
|
|
|
bool IsMatchingVectorIndex(Relation indexRelation, const char *queryVectorPath,
|
|
FuncExpr **vectorExtractorFunc);
|
|
|
|
#endif
|