Search

Search point groups

POST
Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field.

Path parameters

collection_namestringRequired
Name of the collection to search in

Query parameters

consistencyunionOptional
Define read consistency guarantees for the operation
timeoutintegerOptional
If set, overrides global timeout for this request. Unit is seconds.

Request

This endpoint expects an object.
vector
unionRequired
Vector data separator for named and unnamed modes Unnamed mode: { "vector": [1.0, 2.0, 3.0] } or named mode: { "vector": { "vector": [1.0, 2.0, 3.0], "name": "image-embeddings" } }
group_by
stringRequired
Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups.
group_size
integerRequired
Maximum amount of points to return per group
limit
integerRequired
Maximum amount of groups to return
shard_key
unionOptional
Specify in which shards to look for the points, if not specified - look in all shards
filter
unionOptional
Look only for points which satisfies this conditions
params
unionOptional
Additional search params
with_payload
unionOptional
Select which payload to return with the response. Default is false.
with_vector
unionOptional
Options for specifying which vectors to include into response. Default is false.
score_threshold
doubleOptional
Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.
with_lookup
unionOptional
Look for points in another collection using the group ids

Response

This endpoint returns an object
time
doubleOptional
Time spent to process this request
status
stringOptional
result
objectOptional
POST
1curl -X POST http://localhost:6333/collections/collection_name/points/search/groups \
2 -H "api-key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "vector": [
6 1.1
7 ],
8 "group_by": "group_by",
9 "group_size": 1,
10 "limit": 1
11}'
200Successful
1{
2 "time": 1.1,
3 "status": "status",
4 "result": {
5 "groups": [
6 {
7 "hits": [
8 {
9 "id": 1,
10 "version": 1,
11 "score": 1.1
12 }
13 ],
14 "id": "id"
15 }
16 ]
17 }
18}