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
qql> INSERT INTO COLLECTION notes VALUES {'text': 'Qdrant is a vector database', 'author': 'alice', 'year': 2024}
@@ -48,7 +48,7 @@ Your query string
48
48
Qdrant instance
49
49
```
50
50
51
-
When you run `INSERT`, the `text` field is automatically converted into a dense vector using [Fastembed](https://github.com/qdrant/fastembed). In **hybrid mode** (`USING HYBRID`), a sparse BM25 vector is also generated alongside the dense vector, and searches use Qdrant's Reciprocal Rank Fusion (RRF) to merge the results of both retrieval methods.
51
+
When you run `INSERT`, the `text` field is automatically converted into a dense vector using [Fastembed](https://github.com/qdrant/fastembed). In **hybrid mode** (`USING HYBRID`), a sparse BM25 vector is also generated alongside the dense vector, and searches use Qdrant's Reciprocal Rank Fusion (RRF) by default to merge the results of both retrieval methods. You can switch hybrid search to DBSF with `FUSION 'dbsf'`.
52
52
53
53
---
54
54
@@ -82,7 +82,7 @@ Full documentation lives in the [`docs/`](docs/) folder and at **[pavanjava.gith
82
82
|---|---|
83
83
|[Getting Started](docs/getting-started.md)| Installation, connecting, first queries |
Copy file name to clipboardExpand all lines: docs/getting-started.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Your query string
24
24
Qdrant instance
25
25
```
26
26
27
-
When you run `INSERT`, the `text` field is automatically converted into a dense vector using [Fastembed](https://github.com/qdrant/fastembed). In **hybrid mode** (`USING HYBRID`), a sparse BM25 vector is also generated alongside the dense vector, and searches use Qdrant's Reciprocal Rank Fusion (RRF) to merge the results of both retrieval methods.
27
+
When you run `INSERT`, the `text` field is automatically converted into a dense vector using [Fastembed](https://github.com/qdrant/fastembed). In **hybrid mode** (`USING HYBRID`), a sparse BM25 vector is also generated alongside the dense vector, and searches use Qdrant's Reciprocal Rank Fusion (RRF) by default to merge the results of both retrieval methods. You can override that with `FUSION 'dbsf'` on hybrid searches.
28
28
29
29
---
30
30
@@ -138,6 +138,9 @@ SEARCH notes SIMILAR TO 'vector storage engines' LIMIT 3
138
138
-- Filter results
139
139
SEARCH notes SIMILAR TO 'vector databases'LIMIT5WHERE year >=2023
140
140
141
+
-- Browse with pagination
142
+
SCROLL FROM notes LIMIT10
143
+
141
144
-- List all collections
142
145
SHOW COLLECTIONS
143
146
@@ -150,7 +153,7 @@ SELECT * FROM notes WHERE id = 1
|`Connection failed: ...`| Qdrant unreachable at given URL | Check that Qdrant is running and the URL is correct |
172
175
|`INSERT requires a 'text' field in VALUES`|`text` key missing from the VALUES dict | Add `'text': '...'` to your dict |
173
176
|`Vector dimension mismatch: collection '...' expects X dims, but model produces Y dims`| Model used in INSERT differs from the one used to create the collection | Use `USING MODEL` to specify the same model as the collection was created with |
174
-
|`Collection '...' does not exist`| SEARCH / SELECT / DROP / DELETE on a non-existent collection | Check name spelling or run `SHOW COLLECTIONS`|
177
+
|`Collection '...' does not exist`| SEARCH / SCROLL / SELECT / DROP / DELETE on a non-existent collection | Check name spelling or run `SHOW COLLECTIONS`|
175
178
|`Unexpected token '...'; expected a QQL statement keyword`| Unrecognized statement | Check the query syntax and supported statement list |
176
179
|`SELECT requires a string or integer point id, got '...'`|`SELECT` used with a non-ID filter value | Use `SELECT * FROM <collection> WHERE id = '<id>'` or an integer ID |
177
180
|`Unterminated string literal (at position N)`| A string is missing its closing quote | Close the string with a matching `'` or `"`|
178
181
|`Unexpected character '@' (at position N)`| A character not part of QQL syntax | Remove or quote the offending character |
179
182
|`Expected a filter operator after field '...'`| Unknown operator in WHERE clause | Use one of: `=`, `!=`, `>`, `>=`, `<`, `<=`, `IN`, `NOT IN`, `BETWEEN`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `MATCH`|
180
183
|`Expected ')' ...`| Unclosed parenthesis in WHERE clause | Add the missing `)` to close the group |
181
184
|`Qdrant error during SEARCH: ...`| Hybrid search on a non-hybrid collection, or wrong vector names | Ensure the collection was created with `HYBRID` before using `USING HYBRID` in INSERT/SEARCH |
185
+
|`Qdrant error during SCROLL: ...`| Qdrant rejected scroll request | Verify collection state, filter, and cursor (`AFTER`) value |
182
186
|`Unknown index type '...'`| Invalid schema type in CREATE INDEX | Use one of: `keyword`, `integer`, `float`, `bool`, `text`, `geo`, `datetime`|
183
187
|`Qdrant error during CREATE INDEX: ...`| Qdrant rejected the index creation | Check field name and collection state |
@@ -14,7 +14,7 @@ SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n>
14
14
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> USING MODEL '<model_name>'
15
15
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> [USING MODEL '<model>'] WHERE <filter>
16
16
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> USING HYBRID
17
-
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> USING HYBRID [DENSE MODEL '<model>'] [SPARSE MODEL '<model>'] [WHERE <filter>]
17
+
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> USING HYBRID [FUSION 'rrf|dbsf'] [DENSE MODEL '<model>'] [SPARSE MODEL '<model>'] [WHERE <filter>]
18
18
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> USING SPARSE [MODEL '<sparse_model>']
19
19
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> EXACT
20
20
SEARCH <collection_name> SIMILAR TO '<query_text>' LIMIT <n> [USING ...] [WHERE <filter>] [RERANK] WITH { hnsw_ef: <n>, exact: true|false, acorn: true|false }
@@ -33,7 +33,7 @@ Search only papers published after 2020:
33
33
SEARCH articles SIMILAR TO 'deep learning'LIMIT10WHERE year >2020
Hybrid search (combines dense semantic + sparse BM25 keyword retrieval via RRF by default):
37
37
```sql
38
38
SEARCH articles SIMILAR TO 'attention mechanism'LIMIT10 USING HYBRID
39
39
```
@@ -120,15 +120,41 @@ SEARCH articles SIMILAR TO 'RAG' LIMIT 10 WHERE tag = 'li' WITH { acorn: true }
120
120
121
121
---
122
122
123
+
## SCROLL — pagination / browsing
124
+
125
+
Use `SCROLL` to iterate through points in a collection page by page.
126
+
127
+
**Syntax:**
128
+
```sql
129
+
SCROLL FROM<collection_name>LIMIT<n>
130
+
SCROLL FROM<collection_name>WHERE<filter>LIMIT<n>
131
+
SCROLL FROM<collection_name> AFTER '<point_id>'LIMIT<n>
132
+
SCROLL FROM<collection_name>WHERE<filter> AFTER <point_id>LIMIT<n>
133
+
```
134
+
135
+
**Examples:**
136
+
```sql
137
+
SCROLL FROM articles LIMIT50
138
+
SCROLL FROM articles WHERE year >=2024LIMIT50
139
+
SCROLL FROM articles AFTER 'cursor-id'LIMIT50
140
+
```
141
+
142
+
**Behavior:**
143
+
- Returns points in ID order with payloads.
144
+
- Returns a `next_offset` cursor when more points are available.
145
+
- Use `AFTER <next_offset>` to fetch the next page.
146
+
147
+
---
148
+
123
149
## Hybrid Search (USING HYBRID)
124
150
125
-
Hybrid search combines **dense semantic vectors** and **sparse BM25 keyword vectors** in a single query and merges the results with Qdrant's **Reciprocal Rank Fusion (RRF)** algorithm. This typically outperforms either method alone.
151
+
Hybrid search combines **dense semantic vectors** and **sparse BM25 keyword vectors** in a single query. By default QQL merges the two result sets with Qdrant's **Reciprocal Rank Fusion (RRF)** algorithm, and you can optionally switch to **DBSF** with a `FUSION` clause.
126
152
127
153
### How it works internally
128
154
129
155
1. Both a dense vector (`TextEmbedding`) and a sparse BM25 vector (`SparseTextEmbedding`) are generated from your query text.
130
156
2. Qdrant fetches the top candidates from each index independently (`prefetch limit = LIMIT × 4`).
131
-
3. The two result lists are merged using RRF — a rank-based fusion that does not require score normalization.
157
+
3. The two result lists are merged using the selected fusion strategy (`RRF` by default, or `DBSF` when requested).
132
158
4. The final top-N results are returned.
133
159
134
160
### Step 1: Create a hybrid collection
@@ -161,6 +187,9 @@ SEARCH articles SIMILAR TO 'transformer architecture' LIMIT 10 USING HYBRID
161
187
-- Hybrid search with a WHERE filter
162
188
SEARCH articles SIMILAR TO 'attention'LIMIT10 USING HYBRID WHERE year >=2017
163
189
190
+
-- Hybrid with DBSF fusion
191
+
SEARCH articles SIMILAR TO 'hybrid retrieval'LIMIT10 USING HYBRID FUSION 'dbsf'
192
+
164
193
-- Hybrid with custom dense model
165
194
SEARCH articles SIMILAR TO 'embeddings'LIMIT5
166
195
USING HYBRID DENSE MODEL 'BAAI/bge-base-en-v1.5'
@@ -176,6 +205,7 @@ SEARCH articles SIMILAR TO 'sparse retrieval' LIMIT 5
176
205
|---|---|
177
206
| Dense model | configured default (`sentence-transformers/all-MiniLM-L6-v2`) |
0 commit comments