chore: add one rust SDK e2e example (#876)

Co-authored-by: Chang She <759245+changhiskhan@users.noreply.github.com>
This commit is contained in:
Lei Xu
2024-01-26 22:41:20 -08:00
committed by GitHub
parent 77b5b1cf0e
commit b49bc113c4
3 changed files with 94 additions and 10 deletions

View File

@@ -42,7 +42,6 @@
sudo apt install -y protobuf-compiler libssl-dev
```
## How to connect to a database
=== "Python"
@@ -70,10 +69,12 @@
#[tokio::main]
async fn main() -> Result<()> {
let uri = "data/sample-lancedb";
let db = connect(&uri).await?;
let db = connect(uri).await?;
}
```
!!! info "See [examples/simple.rs](https://github.com/lancedb/lancedb/tree/main/rust/vectordb/src/examples/simple.rs) for a full working example."
LanceDB will create the directory if it doesn't exist (including parent directories).
If you need a reminder of the uri, you can call `db.uri()`.
@@ -286,7 +287,7 @@ Once you've embedded the query, you can find its nearest neighbors using the fol
```
By default, LanceDB runs a brute-force scan over dataset to find the K nearest neighbours (KNN).
users can speed up the query by creating vector indices over the vector columns.
For tables with more than 50K vectors, creating an ANN index is recommended to speed up search performance.
=== "Python"