From 6a77ce1db398acc875f6abafd799be8aedd1b666 Mon Sep 17 00:00:00 2001 From: generall Date: Mon, 19 Oct 2026 20:25:08 +0200 Subject: [PATCH] Add simple-hybrid-text example: dense vector + BM25-scored text field Same shape as simple-hybrid, but the sparse vector is replaced by a zipf-distributed text payload field indexed with `scoring: bm25`, and `memory:` is used instead of `on_disk` / `always_ram`. Co-Authored-By: Claude Opus 5.5 (1M context) --- examples/simple-hybrid-text.yaml | 50 ++++++++++++++++++++++++++++++++ src/config/examples.rs | 5 ++++ 2 files changed, 55 insertions(+) create mode 100644 examples/simple-hybrid-text.yaml diff --git a/examples/simple-hybrid-text.yaml b/examples/simple-hybrid-text.yaml new file mode 100644 index 0000000..46c1367 --- /dev/null +++ b/examples/simple-hybrid-text.yaml @@ -0,0 +1,50 @@ +# Example bfb upload config for a simple hybrid (dense + full-text) collection: +# one 768-d dense vector with turbo-2bit quantization and one zipf-distributed +# text payload field with a full-text index (the BM25-side of the hybrid), +# plus a couple of payload fields to filter on. +# +# bfb upload --example simple-hybrid-text -n 1M -b 256 -p 16 -t 8 \ +# --uri http://localhost:6334 + +collection: + name: benchmark + id: uuid + payload: + memory: cold + + optimizers: + default_segment_number: 3 + + quantization: + type: turbo-2bit + memory: pinned + + vectors: + - name: image + size: 768 + distance: cosine + datatype: float32 + memory: cold + source: random + + fields: + - name: text + type: text + tokenizer: word + scoring: bm25 # rank by BM25 (Qdrant 1.19.3+); implies phrase matching + memory: cold + source: + type: random + vocab_size: 100000 + min_length: 100 + max_length: 100 + distribution: zipf + - name: a + type: keyword + source: + type: random + cardinality: 10 + values_per_point: 1 + - name: b + type: float + source: { type: random, min: -1.0, max: 1.0 } diff --git a/src/config/examples.rs b/src/config/examples.rs index a21f35e..868b461 100644 --- a/src/config/examples.rs +++ b/src/config/examples.rs @@ -70,6 +70,11 @@ pub static EXAMPLES: &[Example] = &[ Upload, "Hybrid collection: dense + sparse vectors and a few payload fields" ), + example!( + "simple-hybrid-text", + Upload, + "Hybrid collection: dense vector + full-text indexed field and a few payload fields" + ), example!( "upload-dataset-config", Upload,