Search

Recommend points

POST
Retrieves points that are closer to stored positive examples and further from negative examples.

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.
limit
integerRequired
Max number of result to return
shard_key
unionOptional
Specify in which shards to look for the points, if not specified - look in all shards
positive
list of unionsOptional
Look for vectors closest to those
negative
list of unionsOptional
Try to avoid vectors like this
strategy
unionOptional
How to use positive and negative examples to find the results
filter
unionOptional
Look only for points which satisfies this conditions
params
unionOptional
Additional search params
offset
integerOptional
Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.
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.
using
unionOptional
Define which vector to use for recommendation, if not specified - try to use default vector
lookup_from
unionOptional
The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection

Response

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