mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-12 15:46:54 +08:00
Added support function for l2_normalize to ivfflat
This commit is contained in:
@@ -85,8 +85,12 @@ InsertTuple(Relation index, Datum *values, bool *isnull, ItemPointer heap_tid, R
|
||||
normprocinfo = IvfflatOptionalProcInfo(index, IVFFLAT_NORM_PROC);
|
||||
if (normprocinfo != NULL)
|
||||
{
|
||||
if (!IvfflatNormValue(normprocinfo, index->rd_indcollation[0], &value, IvfflatGetType(index)))
|
||||
Oid collation = index->rd_indcollation[0];
|
||||
|
||||
if (!IvfflatCheckNorm(normprocinfo, collation, value))
|
||||
return;
|
||||
|
||||
value = IvfflatNormValue(IvfflatOptionalProcInfo(index, IVFFLAT_NORMALIZE_PROC), collation, value);
|
||||
}
|
||||
|
||||
/* Find the insert page - sets the page and list info */
|
||||
|
||||
Reference in New Issue
Block a user