Skip to main content

FindDescriptorBatch

The batch form of FindDescriptor has the same class, engine, metric, filter and result semantics. Any authenticated user may call this command.

With KNN, n_descriptors defaults to 1 and declares the number of consecutive vectors in one input blob. It and k_neighbors must be positive and at most 2147483647. The blob must contain exactly that many vectors with common dimensions. Without KNN this is a metadata lookup and consumes no input blob.

Every input gets one global top-k across compatible selected classes. Returned objects are the distinct union of those neighbors. With distances: true, each row includes _distances pairs of input index and score. Multiple inputs have no single nearest-first row order; use an explicit sort when needed.

with_class restricts every input before top-k, including with knn_first: true. All input vectors share the command’s limits and execution budget. Qualified immutable snapshots may execute independent work in parallel; no query thread-count or lookup hint is required.

This tested example supplies two three-dimensional vectors in one input blob.

[{
"FindDescriptorBatch": {
"engine": "IVF",
"with_class": "party_faces",
"k_neighbors": 4,
"n_descriptors": 2,
"labels": true,
"distances": true
}
}]
[{
"FindDescriptorBatch": {
"entities": [{
"_class": "party_faces",
"_distances": [
[0, 2.0],
[1, 4.0]
],
"_label": "Pilypas Bruno"
}, {
"_class": "party_faces",
"_distances": [
[0, 2.0],
[1, 4.0]
],
"_label": "Era Aivar"
}, {
"_class": "party_faces",
"_distances": [
[0, 2.0],
[1, 2.0]
],
"_label": "Radha Akash"
}, {
"_class": "party_faces",
"_distances": [
[0, 1.0],
[1, 3.0]
],
"_label": "Kwasi Publius"
}, {
"_class": "party_faces",
"_distances": [
[1, 2.0],
[0, 4.0]
],
"_label": "Broccomaglos Tyree"
}, {
"_class": "party_faces",
"_distances": [
[1, 2.0],
[0, 4.0]
],
"_label": "Gregoria Hine"
}, {
"_class": "party_faces",
"_distances": [
[1, 1.0],
[0, 3.0]
],
"_label": "Marjeta Pe\u0111a"
}, {
"_class": "party_faces",
"_distances": [
[0, 1.0],
[1, 5.0]
],
"_label": "Harisha Balaram"
}],
"returned": 8,
"status": 0
}
}]