ru_annoy

Crates.ioru_annoy
lib.rsru_annoy
version0.1.3
sourcesrc
created_at2019-05-09 16:42:13.317529
updated_at2021-03-04 17:13:55.713848
descriptionA rust implementation of annoy(https://github.com/spotify/annoy) (Index serving only). Providing C api as well
homepage
repositoryhttps://github.com/hanabi1224/RuAnnoy
max_upload_size
id133105
size186,308
hanabi1224 (hanabi1224)

documentation

README

RuAnnoy

main appveyor travis MIT License

This library is a rust port of spotify/annoy , currently only index serving is supported.

Install via crates.io

Crates.io codecov

# Cargo.toml
[dependencies]
ru_annoy = "0"

Usage

use ru_annoy::*;

let index = AnnoyIndex::load(10, "index.ann", IndexType::Angular).unwrap();
let v0 = index.get_item_vector(0);
let nearest = index.get_nearest(v0.as_ref(), 5, -1, true);

FFI support

kotlin/java

It uses JNI bindings to rust crate and is ~5-10x faster than pure java implementation in benchmark scenario

Install via jitpack.io

Release

repositories {
  mavenCentral()
  maven { url 'https://jitpack.io' }
}
  
dependencies {
  implementation 'com.github.hanabi1224:RuAnnoy:<tag>'
}

Usage

val index = AnnoyIndex.tryLoad("index.5d.ann", 5, IndexType.Angular)

dotnet

Runtimes Nuget package
RuAnnoy NuGet version
RuAnnoy-Batteries-Windows-x64 NuGet version
RuAnnoy-Batteries-Linux-x64 NuGet version
RuAnnoy-Batteries-Darwin-x64 NuGet version

Install via nuget

  <ItemGroup>
    <PackageReference Include="RuAnnoy" Version="*" />
    <PackageReference Include="RuAnnoy-Batteries-Windows-x64" Version="*" />
  </ItemGroup>

Usage

var index = AnnoyIndex.Load("index.5d.ann", 5, IndexType.Angular);

TODO

  • Index building support
  • CLI tool to build index from file
Commit count: 96

cargo fmt