mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 21:08:31 +02:00
* Add new 'Create a Payload Index' section * Add indexing tip to low latency search, search, and filtering docs * Add bash code snippet * Edits * Update qdrant-landing/content/documentation/manage-data/indexing.md Co-authored-by: Tim Visée <tim@visee.me> --------- Co-authored-by: Tim Visée <tim@visee.me>
27 lines
1.1 KiB
Rust
27 lines
1.1 KiB
Rust
use qdrant_client::qdrant::{HnswConfigDiffBuilder, UpdateCollectionBuilder};
|
|
|
|
pub async fn main() -> anyhow::Result<()> {
|
|
let client = qdrant_client::Qdrant::from_url("http://localhost:6334").build()?; // @hide
|
|
|
|
// @block-start get-current-value
|
|
let base_ef = client
|
|
.collection_info("{collection_name}")
|
|
.await?
|
|
.result
|
|
.and_then(|info| info.config)
|
|
.and_then(|config| config.hnsw_config)
|
|
.and_then(|hnsw| hnsw.ef_construct);
|
|
// @block-end get-current-value
|
|
|
|
// @block-start update-collection
|
|
client
|
|
.update_collection(
|
|
UpdateCollectionBuilder::new("{collection_name}")
|
|
.hnsw_config(HnswConfigDiffBuilder::default().ef_construct(base_ef.unwrap_or(100) + 1)),
|
|
)
|
|
.await?;
|
|
// @block-end update-collection
|
|
|
|
Ok(())
|
|
}
|