breezykermo / oak

1 stars 0 forks source link

Implement search for the ACORN index #38

Open breezykermo opened 6 days ago

breezykermo commented 6 days ago

We need to implement search across the FFI. The cpp function looks like this:

    void search(
            idx_t n,
            const float* x,
            idx_t k,
            float* distances,
            idx_t* labels,
            char* filter_id_map,
            const SearchParameters* params = nullptr) const;

See also the example in the main README.

It might be worth asking Liana about these arguments, rather than trying to infer their semantics. In particular, why is the filter_id_map a char*? Is the assumption that attributes are always represented as integers (idx_t)? The distances seems to be k * nq in the test_acorn.cpp.

The rest of the PR here should remove the Searchable trait, and implement a similar search function on the Dataset trait.