Skip to main content

Crate vectrixdb

Crate vectrixdb 

Source
Expand description

Client for VectrixDB: collections, documents, text search, sources.

use vectrixdb::{Client, SearchOptions};

let db = Client::new("http://127.0.0.1:8000").key("...").build()?;
for hit in db.search("docs", "refunds", SearchOptions::default()).await? {
    println!("{} ({:.2}): {}", hit.citation, hit.score, hit.text);
}

Every call is an async method on Client; the blocking feature adds [BlockingClient] with the same calls, synchronous.

ClientBuilder also has what a company network asks for: allow_http (a key or token over plain http:// to another machine is refused without it), key_header, token_header, header, prefix, gateway_paths, ca_certificate and identity. The client never follows a redirect, and never prints the key or token.

Modules§

generated

Structs§

AddOptions
Options for Client::add_document.
Added
What add_document reports.
Client
An async VectrixDB client.
ClientBuilder
Builds a Client: Client::new(url).key("...").build().
Collection
One collection, as GET /api/v1/collections/{name} describes it.
CreateOptions
Options for Client::create_collection.
Document
One kept document, as GET /api/v1/collections/{name}/documents lists it.
Hit
One search result.
Refreshed
What refresh_sources reports.
SearchOptions
Options for Client::search.
Source
A feed or page the collection is kept current from.
SourceOptions
Options for Client::add_source.
Text
One point for Client::add_texts.

Enums§

Error
Everything a call can fail with.
GatewayPaths
The list a gateway team hands over: each route name’s gateway path.
Kind
What kind of refusal the server sent, by status.
Mode
Which search a query runs.

Type Aliases§

Result
std::result::Result with this crate’s Error.