Skip to content

Commit 6acf076

Browse files
committed
Add missing DenseVectorProperty documentation
1 parent 3e66623 commit 6acf076

File tree

3 files changed

+123
-44
lines changed

3 files changed

+123
-44
lines changed

output/schema/schema.json

Lines changed: 47 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_types/mapping/DenseVectorProperty.ts

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,43 @@ import { PropertyBase } from './Property'
2222

2323
export class DenseVectorProperty extends PropertyBase {
2424
type: 'dense_vector'
25-
element_type?: DenseVectorElementType
25+
/**
26+
* Number of vector dimensions. Can't exceed `4096`. If `dims` is not specified, it will be set to the length of
27+
* the first vector added to the field.
28+
*/
2629
dims?: integer
27-
similarity?: DenseVectorSimilarity
30+
/**
31+
* The data type used to encode vectors. The supported data types are `float` (default), `byte`, and `bit`.
32+
* @server_default float
33+
*/
34+
element_type?: DenseVectorElementType
35+
/**
36+
* If `true`, you can search this field using the kNN search API.
37+
* @server_default true
38+
*/
2839
index?: boolean
40+
/**
41+
* An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters
42+
* that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the
43+
* expense of slower indexing speed.
44+
*
45+
* This parameter can only be specified when `index` is `true`.
46+
*/
2947
index_options?: DenseVectorIndexOptions
48+
/**
49+
* The vector similarity metric to use in kNN search.
50+
*
51+
* Documents are ranked by their vector field's similarity to the query vector. The `_score` of each document will
52+
* be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds
53+
* to a higher ranking.
54+
*
55+
* Defaults to `l2_norm` when `element_type` is `bit` otherwise defaults to `cosine`.
56+
*
57+
* `bit` vectors only support `l2_norm` as their similarity metric.
58+
*
59+
* This parameter can only be specified when `index` is `true`.
60+
*/
61+
similarity?: DenseVectorSimilarity
3062
}
3163

3264
export enum DenseVectorElementType {
@@ -95,10 +127,38 @@ export enum DenseVectorSimilarity {
95127
}
96128

97129
export class DenseVectorIndexOptions {
98-
type: DenseVectorIndexOptionsType
99-
m?: integer
100-
ef_construction?: integer
130+
/**
131+
* The confidence interval to use when quantizing the vectors. Can be any value between and including `0.90` and
132+
* `1.0` or exactly `0`. When the value is `0`, this indicates that dynamic quantiles should be calculated for
133+
* optimized quantization. When between `0.90` and `1.0`, this value restricts the values used when calculating
134+
* the quantization thresholds.
135+
*
136+
* For example, a value of `0.95` will only use the middle `95%` of the values when calculating the quantization
137+
* thresholds (e.g. the highest and lowest `2.5%` of values will be ignored).
138+
*
139+
* Defaults to `1/(dims + 1)` for `int8` quantized vectors and `0` for `int4` for dynamic quantile calculation.
140+
*
141+
* Only applicable to `int8_hnsw`, `int4_hnsw`, `int8_flat`, and `int4_flat` index types.
142+
*/
101143
confidence_interval?: float
144+
/**
145+
* The number of candidates to track while assembling the list of nearest neighbors for each new node.
146+
*
147+
* Only applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.
148+
* @server_default 100
149+
*/
150+
ef_construction?: integer
151+
/**
152+
* The number of neighbors each node will be connected to in the HNSW graph.
153+
*
154+
* Only applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.
155+
* @server_default 16
156+
*/
157+
m?: integer
158+
/**
159+
* The type of kNN algorithm to use.
160+
*/
161+
type: DenseVectorIndexOptionsType
102162
}
103163

104164
export enum DenseVectorIndexOptionsType {

0 commit comments

Comments
 (0)