Vector Set Class
gxVectorSet searches many vector index files as one, through a .vixset manifest (DataReel 7.4).
Overview
The Manifest
Searches
Overview
A set is a day file each, partitions of a large index, or both. The files are listed in a small text manifest, <name>.vixset, next to them. Each line holds a file's path (relative to the manifest, never absolute and never "..") with its node counts, the range of its tag 2 (the day) and a CRC of the header fields that never change; a file replaced by one that does not match is refused.
# gxVectorSet manifest set days version 1 spec example/days dim 24 element f32 metric l2 codec 0 file 2026/11/11/vectors.vix nodes=500 deleted=0 tag2=20261111..20261111 crc=1a2b3c4d
Files are opened read only when a search first needs them and kept in a cache of max_open files. A search with a day range skips a file whose tag 2 range is outside it without opening it. Results are merged by distance, then file, then id: the same for any number of threads. A listed file that is missing (an archived day) is skipped and counted, unless strict is set. The live day's writer can put its own open index in the set with AttachOpen(). The example: vector_days.
The Manifest
gxvError Create(const char *path, const char *name, unsigned dim, gxvElementType type = gxvFLOAT32, gxvMetric metric = gxvL2, const char *spec = 0)A new, empty set: the manifest is written.
gxvError Open(const char *path, const char *spec = 0, unsigned max_open = 16) / gxvError OpenFile(const char *vix_path, const char *spec = 0) / void Close()Reads a manifest (a spec, when given, must be the set's); or one .vix file as a set of one.
gxvError AddFile(const char *rel_path) / RemoveFile(const char *rel_path)Lists or removes a file (it is opened and checked against the set). Writes the manifest (to .tmp, synced, renamed).
gxvError Refresh()Copies every file's counts and tag 2 range from its header again; a file that no longer matches its CRC is an error.
static int SafeRelPath(const std::string &rel)1 if a path may be in a manifest: relative, no "..", no empty or "." parts, no backslash or control characters.
Searches
gxvError Search(const float *query, const gxvSetSearch &opt, std::vector<gxvSetResult> &results, gxvSetStats *stats = 0) constSearches the files. gxvSetSearch: k, ef, filter, day_range with day_lo/day_hi, threads, strict. Each gxvSetResult names its file (an index into Files()).
gxvError AttachOpen(const char *rel_path, gxVectorIndex *vix)A writer's own open index for a listed file: searched as it is, never reopened or evicted; 0 detaches it.
unsigned long long Skipped() / Opened() / Missing() / Reloaded() const; const std::string &Error() constWhat the last search did; gxvSetStats gives the same per search for callers searching from several threads.