Closed asilvas closed 11 months ago
@asilvas Thanks a lot for this great PR, please allow me some time to review.
Let me know if there's anything I can do to progress this PR. Thanks
@asilvas Sorry for slow reply. I have been occupied with work recently. I'll deal with it later this week.
Another point that I'm a little concerned about is that Index
is an abstract class in faiss. It has only a few methods, but we warped many things that are not originally on Index.
maybe we should have a IndexFlat
class and a pure Index
class?
btw, I'm sorry that it's time for me to go to bed. i will reply tomorrow.
Another point that I'm a little concerned about is that
Index
is an abstract class in faiss. It has only a few methods, but we warped many things that are not originally on Index. maybe we should have aIndexFlat
class and a pureIndex
class?btw, I'm sorry that it's time for me to go to bed. i will reply tomorrow.
Index is abstract, and any index you've created that does not implement a function (ala add_with_ids
) will throw. The behavior is highly consistent with the native implementation. All faiss-node needs to be is a wrapper -- let native lib throw when used incorrectly.
Index is abstract, and any index you've created that does not implement a function (ala
add_with_ids
) will throw. The behavior is highly consistent with the native implementation. All faiss-node needs to be is a wrapper -- let native lib throw when used incorrectly.
I reconfirmed and it's as you said. But I will remove fromFactory
from IndexFlatIP
and IndexFlatL2
Resolves https://github.com/ewfian/faiss-node/issues/37 and much more:
toBuffer
&fromBuffer
(10x+ faster than re-adding vectors, but still somehow 2x slower than reading from disk)Sorry for the big sweeping changes. I don't like to put this much into 1 PR, but due to considerable complications with NAPI they were necessary.