Skip to content

Commit c520637

Browse files
[DOC-12715] Document New Search Request Params for Search Fine-Tuning (#291)
* [quickfix]: quickfix: strange font problem on diagram (#274) Seems to have been caused by extra space in the label. * [DOC-12610]: Document `nprobe` tweaking * [DOC=12610]: Moved fine-tuning menu entry. [DOC=12610]: Moved the stem declaration; wasn't working in the old position. * [DOC=12610]: Moved and reworded the sections for clarity. Adding link to search-index-params.adoc * [DOC-12715] Add documentation to the JSON search request example and topics around the new added memory-efficient setting and the params object for probe and centroid tuning * [DOC-12715] Adding on to Ray's documentation to provide a link to Search Request Params. * [DOC-12715] Comments from peer review --------- Co-authored-by: Ray Offiah <[email protected]> Co-authored-by: Ray Offiah <[email protected]>
1 parent e13edbf commit c520637

File tree

4 files changed

+51
-2
lines changed

4 files changed

+51
-2
lines changed

modules/search/examples/run-search-full-request.jsonc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
"knn": [
4848
{
4949
"k": 10,
50+
"params": {
51+
"ivf_nprobe_pct": 1,
52+
"ivf_max_codes_pct": 0.2
53+
},
5054
"field": "vector_field",
5155
"vector": [ 0.707106781186548, 0, 0.707106781186548 ]
5256
}

modules/search/pages/search-request-params.adoc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ The Search Service returns the `k` closest vectors to the vector given in `vecto
173173

174174
NOTE: The <<size-limit,size or limit property>> overrides any value set in `k`.
175175

176+
|params |Object |No a|
177+
178+
Enter additional parameters to control how the Search Service compares vectors when running a Vector Search request.
179+
180+
For more information about the `params` object, see <<knn-params,>>.
181+
176182
|field |String |Yes a|
177183

178184
The name of the field that contains the vector data you want to search.
@@ -199,6 +205,40 @@ For more information about the dimension value, see the xref:search-index-params
199205

200206
|====
201207

208+
[#knn-params]
209+
=== Knn params Object
210+
211+
Use the `params` object inside a `knn` object to fine tune the probes and centroids the Search Services uses and searches while running a Vector Search request.
212+
213+
The `params` object can contain the following properties:
214+
215+
[cols="1,1,1,4"]
216+
|====
217+
|Property |Type |Required? |Description
218+
219+
|ivf_nprobe_pct |Number (percentage) |No a|
220+
221+
Set the `ivf_nprobe_pct` value to control the percentage of probes, or the percentage of clusters, that the Search Service searches during a single Vector Search query.
222+
223+
The Search Service automatically calculates a default `nprobe` percentage based on the vectors in a given partition of your Vector Search index.
224+
For more information about this calculation, see xref:vector-search:fine-tune-vector-search.adoc[].
225+
226+
If you set the value of `ivf_nprobe_pct` higher than this default calculated value, the Search Service will search a higher percentage of clusters in your processed vectors.
227+
This can increase your accuracy and recall for Vector Search, but requires more compute time for each query.
228+
229+
In the example, the Search Service searches only `1%` of the total available clusters.
230+
231+
|ivf_max_codes_pct |Number (percentage out of 100) |No a|
232+
233+
Set the `ivf_max_codes_pct` value to control the maximum number of centroids that the Search Service accesses during a single Vector Search query.
234+
235+
By default, this value is always 100%.
236+
237+
If you reduce your `ivf_max_codes_pct` value, the Search Service accesses fewer centroids, which reduces your Vector Search accuracy and recall, but gives faster compute times for your search.
238+
239+
In the example, the Search Service searches only `0.2%` of the available centroids in your vector data.
240+
|====
241+
202242
[#query-object]
203243
== Query Object
204244

modules/search/partials/vector-search-field-descriptions.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// tag::optimized_for[]
2-
For a `vector` child field, choose whether the Search Service should prioritize recall or latency when returning similar vectors in search results:
2+
For a `vector` child field, choose whether the Search Service should prioritize recall, latency, or memory efficiency when returning similar vectors in search results:
33

44
* *recall*: The Search Service prioritizes returning the most accurate result.
55
This may increase resource usage for Search queries.
@@ -12,6 +12,11 @@ This may reduce the accuracy of results.
1212
+
1313
The Search Service uses half the `nprobe` value calculated for *recall* priority.
1414
15+
* *memory-efficient*: The Search Service prioritizes reducing memory usage and optimizes search operations for less resources.
16+
This may reduce both accuracy (recall) and latency.
17+
+
18+
The Search Service uses either an inverted file index with scalar quantization, or a directly mapped index with exact vector comparisons, depending on the number of vectors in your data.
19+
1520
For more information about Vector Search indexes, see xref:vector-search:vector-search.adoc[] or xref:vector-search:create-vector-search-index-ui.adoc[].
1621
// end::optimized_for[]
1722
// tag::similarity_metric[]

modules/vector-search/pages/fine-tune-vector-search.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ If you have a Vector Search index with `vector_index_optimized_for` set to `"rec
119119
== Fine-Tuning Query Parameters
120120

121121

122-
You can add set the values of `ivf_nprobe_pct` and `ivf_max_codes_pct` in your Vector Search queries to tune the recall or accuracy of your search.
122+
You can set the values of `ivf_nprobe_pct` and `ivf_max_codes_pct` in your Vector Search queries to tune the recall or accuracy of your search.
123123

124124
You can add the following parameters to your query:
125125

0 commit comments

Comments
 (0)