Navigation
API > API/Plugins > API/Plugins/SemanticSearch > API/Plugins/SemanticSearch/IVectorIndex
Description
Search for K nearest neighbors. Continuation receives the results sorted by ascending distance. The continuation is owned (by-value TFunction) so implementations may move it into a deferred task and invoke it asynchronously off the calling thread.
| Name | Search |
| Type | function |
| Header File | /Engine/Plugins/Experimental/SemanticSearch/Source/SemanticSearch/Public/Interfaces/IVectorIndex.h |
| Include Path | #include "Interfaces/IVectorIndex.h" |
void Search
(
TConstArrayView< float > QueryVector,
int32 K,
const TSharedRef< const TArray< int64 > > & IDFilter,
float DistanceCutoff,
TArray< uint32 > & Scratch,
FGraphEventRef IndexReadCompleteEvent,
TFunction< void > &&)> Continuation
) const
Parameters
| Name | Remarks |
|---|---|
| IDFilter | Shared, immutable list of IDs to restrict the search to. Empty array means "no filter". |
| DistanceCutoff | Drop results whose distance is >= this value before returning. Pass TNumericLimits |
| Scratch | Caller-owned scratch buffer that can be reused to speed up some algo |
| IndexReadCompleteEvent | Optional FGraphEventRef the implementation must DispatchSubsequents() on after its index-touching phase finishes. |
| Continuation | Invoked exactly once with the result array. |