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§
Structs§
- AddOptions
- Options for
Client::add_document. - Added
- What
add_documentreports. - Client
- An async VectrixDB client.
- Client
Builder - Builds a
Client:Client::new(url).key("...").build(). - Collection
- One collection, as
GET /api/v1/collections/{name}describes it. - Create
Options - Options for
Client::create_collection. - Document
- One kept document, as
GET /api/v1/collections/{name}/documentslists it. - Hit
- One search result.
- Refreshed
- What
refresh_sourcesreports. - Search
Options - Options for
Client::search. - Source
- A feed or page the collection is kept current from.
- Source
Options - Options for
Client::add_source. - Text
- One point for
Client::add_texts.
Enums§
- Error
- Everything a call can fail with.
- Gateway
Paths - 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.