Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Runtime/RAG/usearch/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ namespace Cloud.Unum.USearch
{
public static class NativeMethods
{
#if UNITY_IOS
private const string LibraryName = "__Internal";
#else
private const string LibraryName = "libusearch_c";
#endif

[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)]
public static extern usearch_index_t usearch_init(ref IndexOptions options, out usearch_error_t error);
Expand Down
13 changes: 3 additions & 10 deletions Runtime/RAG/usearch/USearchIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,10 @@ private int Search<T>(T[] queryVector, int count, out ulong[] keys, out float[]
}
else
{
if (Application.platform == RuntimePlatform.Android)
lock (filterLock)
{
lock (filterLock)
{
FilterFunction = filter;
matches = checked((int)usearch_filtered_search(this._index, queryVectorPtr, scalarKind, (UIntPtr)count, StaticFilter, IntPtr.Zero, keys, distances, out error));
}
}
else
{
matches = checked((int)usearch_filtered_search(this._index, queryVectorPtr, scalarKind, (UIntPtr)count, (int key, IntPtr state) => filter(key), IntPtr.Zero, keys, distances, out error));
FilterFunction = filter;
matches = checked((int)usearch_filtered_search(this._index, queryVectorPtr, scalarKind, (UIntPtr)count, StaticFilter, IntPtr.Zero, keys, distances, out error));
}
}
HandleError(error);
Expand Down
Loading