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
Copy file name to clipboardExpand all lines: solutions/search/vector/dense-vector.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Dense neural embeddings capture semantic meaning by translating content into fix
12
12
- Image similarity search
13
13
- Content-based recommendations
14
14
15
-
## Working with dense vectors in Elasticsearch
15
+
## Working with dense vectors in {{es}}
16
16
17
17
:::{tip}
18
18
Using the `semantic_text` field type provides automatic model management and sensible defaults. [Learn more](../semantic-search/semantic-search-semantic-text.md).
@@ -45,13 +45,13 @@ BBQ currently supports two vector search algorithms, each suited to different sc
45
45
46
46
#### `bbq_hnsw`[bbq-hnsw]
47
47
48
-
When you set a dense vector field’s `index_type`to `bbq_hnsw`, Elasticsearch uses the HNSW algorithm for fast [kNN search](https://www.elastic.co/docs//solutions/search/vector/knn) on compressed vectors. With the default [oversampling](#bbq-oversampling) applied, it delivers better cost efficiency, lower latency, and improved relevance ranking, making it the best choice for large-scale similarity search.
48
+
When you set a dense vector field’s `index_options` parameter to `type: bbq_hnsw`, {{es}} uses the HNSW algorithm for fast [kNN search](https://www.elastic.co/docs//solutions/search/vector/knn) on compressed vectors. With the default [oversampling](#bbq-oversampling) applied, it delivers better cost efficiency, lower latency, and improved relevance ranking, making it the best choice for large-scale similarity search.
49
49
50
50
:::{note}
51
51
Starting in version 9.1, `bbq_hnsw` is the default indexing method for new `dense_vector` fields, so you don’t need to specify it explicitly when creating an index.
52
52
:::
53
53
54
-
The following example creates an index with a `dense_vector` field configured to use the `bbq_hnsw`index type.
54
+
The following example creates an index with a `dense_vector` field configured to use the `bbq_hnsw`algorithm.
55
55
56
56
```console
57
57
PUT bbq_hnsw-index
@@ -89,9 +89,9 @@ PUT bbq_hnsw-index/_mapping
89
89
}
90
90
```
91
91
92
-
After this change, all newly created segments will use the `bbq_hnsw`index type. As you add or update documents, the index will gradually convert to `bbq_hnsw`.
92
+
After this change, all newly created segments will use the `bbq_hnsw`algorithm. As you add or update documents, the index will gradually convert to `bbq_hnsw`.
93
93
94
-
To apply `bbq_hnsw` to all vectors at once, reindex them into a new index where the index type is set to `bbq_hnsw`:
94
+
To apply `bbq_hnsw` to all vectors at once, reindex them into a new index where the `index_options` parameter's `type` is set to `bbq_hnsw`:
95
95
96
96
:::::{stepper}
97
97
::::{step} Create a destination index
@@ -122,16 +122,16 @@ POST _reindex
122
122
"dest": { "index": "my-index-bbq" }
123
123
}
124
124
```
125
-
1. The existing index that you want to reindex into the newly created index with the `bbq_hnsw``index_type`.
125
+
1. The existing index that you want to reindex into the newly created index with the `bbq_hnsw`algorithm.
126
126
::::
127
127
128
128
:::::
129
129
130
130
#### `bbq_flat`[bbq-flat]
131
131
132
-
When you set a dense vector field’s `index_type`to `bbq_flat`, Elasticsearch uses the BBQ algorithm without HNSW. This option generally requires fewer computing resources and works best when the number of vectors being searched is relatively low.
132
+
When you set a dense vector field’s `index_options` parameter to `type: bbq_flat`, {{es}} uses the BBQ algorithm without HNSW. This option generally requires fewer computing resources and works best when the number of vectors being searched is relatively low.
133
133
134
-
The following example creates an index with a `dense_vector` field configured to use the `bbq_flat`index type.
134
+
The following example creates an index with a `dense_vector` field configured to use the `bbq_flat`algorithm.
135
135
136
136
```console
137
137
PUT bbq_flat-index
@@ -155,7 +155,7 @@ PUT bbq_flat-index
155
155
156
156
Oversampling is a technique used with BBQ searches to reduce the accuracy loss from compression. Compression lowers the memory footprint by over 95% and improves query latency, at the cost of decreased result accuracy. This decrease can be mitigated by oversampling during query time and reranking the top results using the full vector.
157
157
158
-
When you run a kNN search on a BBQ-indexed field, Elasticsearch automatically retrieves more candidate vectors than the number of results you request. This oversampling improves accuracy by giving the system more vectors to re-rank using their full-precision values before returning the top results.
158
+
When you run a kNN search on a BBQ-indexed field, {{es}} automatically retrieves more candidate vectors than the number of results you request. This oversampling improves accuracy by giving the system more vectors to re-rank using their full-precision values before returning the top results.
159
159
160
160
```console
161
161
GET bbq-index/_search
@@ -169,15 +169,15 @@ GET bbq-index/_search
169
169
}
170
170
```
171
171
172
-
By default, oversampling is set to 3×, meaning if you request k:10, Elasticsearch retrieves 30 candidates for re-ranking. You don’t need to configure this behavior; it’s applied automatically for BBQ searches.
172
+
By default, oversampling is set to 3×, meaning if you request k:10, {{es}} retrieves 30 candidates for re-ranking. You don’t need to configure this behavior; it’s applied automatically for BBQ searches.
173
173
174
174
:::{note}
175
175
You can change oversampling from the default 3× to another value. Refer to [Oversampling and rescoring for quantized vectors](https://www.elastic.co/docs/solutions/search/vector/knn#dense-vector-knn-search-rescoring) for details.
176
176
:::
177
177
178
178
### Learn more [bbq-learn-more]
179
179
180
-
-[Better Binary Quantization (BBQ) in Lucene and Elasticsearch](https://www.elastic.co/search-labs/blog/better-binary-quantization-lucene-elasticsearch) - Learn how BBQ works, its benefits, and how it reduces memory usage while preserving search accuracy.
180
+
-[Better Binary Quantization (BBQ) in Lucene and {{es}}](https://www.elastic.co/search-labs/blog/better-binary-quantization-lucene-elasticsearch) - Learn how BBQ works, its benefits, and how it reduces memory usage while preserving search accuracy.
181
181
-[Dense vector field type](https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/dense-vector) - Find code examples for using `bbq_hnsw``index_type`.
182
182
-[kNN search](https://www.elastic.co/docs/solutions/search/vector/knn) - Learn about the search algorithm that BBQ works with.
0 commit comments