You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[SHOW COLLECTIONS — list collections](#show-collections--list-collections)
36
43
-[CREATE COLLECTION — create a collection](#create-collection--create-a-collection)
37
44
-[DROP COLLECTION — delete a collection](#drop-collection--delete-a-collection)
@@ -244,6 +251,7 @@ SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> USING MODEL '<model
244
251
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> [USING MODEL '<model>'] WHERE <filter>
245
252
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> USING HYBRID
246
253
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> USING HYBRID [DENSE MODEL '<model>'] [SPARSE MODEL '<model>'] [WHERE <filter>]
254
+
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> [USING ...] [WHERE <filter>] RERANK [MODEL '<reranker_model>']
247
255
```
248
256
249
257
**Examples:**
@@ -508,6 +516,95 @@ Both can be overridden independently with `DENSE MODEL` and `SPARSE MODEL`.
508
516
509
517
---
510
518
519
+
### Cross-Encoder Reranking (RERANK)
520
+
521
+
Appending `RERANK` to any SEARCH statement activates a **second-pass relevance scoring** step using a [cross-encoder](https://www.sbert.net/examples/applications/cross-encoder/README.html) model. Unlike bi-encoders (which encode query and document independently), a cross-encoder processes the **(query, document)** pair jointly, producing a more accurate relevance score at the cost of extra compute.
522
+
523
+
#### How it works internally
524
+
525
+
1. Qdrant executes the normal dense or hybrid search, but fetches `LIMIT × 4` candidates instead of just `LIMIT` — giving the reranker enough material to work with.
526
+
2. Each candidate's `payload["text"]` is paired with the original query text.
527
+
3. The cross-encoder scores all (query, document) pairs in one batch.
528
+
4. Results are sorted **descending by cross-encoder score** and sliced to `LIMIT`.
529
+
5. The `score` column in the output reflects the cross-encoder relevance score (raw logits — higher is more relevant).
530
+
531
+
#### Syntax
532
+
533
+
```
534
+
SEARCH <name> SIMILAR TO '<query>' LIMIT <n> RERANK
535
+
SEARCH <name> SIMILAR TO '<query>' LIMIT <n> RERANK MODEL '<cross_encoder_model>'
536
+
```
537
+
538
+
`RERANK` must come **after** any `USING` and `WHERE` clauses:
> **Note on scores:** After reranking, the `score` column shows the cross-encoder's raw logit (can be any real number, unbounded). Do not compare reranked scores to non-reranked cosine similarity scores — they are on different scales.
605
+
606
+
---
607
+
511
608
### SHOW COLLECTIONS — list collections
512
609
513
610
Lists all collections in the connected Qdrant instance.
@@ -670,6 +767,25 @@ SEARCH docs SIMILAR TO 'hello' LIMIT 5
0 commit comments