View Source Qdrant.Api.Http.Points (Qdrant v0.0.8)
Qdrant API Points. Float-point vectors with payload.
Points are the main data structure in Qdrant. Each point is a vector of floats, that is associated with an ID and a payload. Qdrant allows to perform search operations on points, and also to store arbitrary JSON payloads with each point. Points are stored in collections, and each collection has its own set of vectors.
Link to this section Summary
Functions
Remove all payload for specified points
Count points which matches given filtering condition
Delete specified key payload for points
Retrieve full information of single point by id.
Retrieve multiple points by specified IDs.
Replace full payload of points with new one
Look for the points which are closer to stored positive examples and at the same time further to negative examples.
Request points based on positive and negative examples.
Scroll request - paginate over all points which matches given filtering condition
Retrieve closest points based on vector similarity and given filtering conditions
Retrieve by batch the closest points based on vector similarity and given filtering conditions
Set payload values for points
Perform insert + updates on points. If point with given ID already exists - it will be overwritten. See more on qdrant
Link to this section Types
@type consistency() :: non_neg_integer() | :majority | :quorum | :all
@type delete_body() :: %{points: [non_neg_integer() | String.t()]} | %{ filter: %{ must: filter_type(), should: filter_type(), must_not: filter_type() } }
@type delete_payload_body() :: %{ keys: [String.t()], points: extended_point_id(), filter: filter_type() }
@type extended_point_id() :: [non_neg_integer() | String.t()]
@type field_condition() :: %{ key: String.t(), match: %{value: String.t()} | %{text: String.t()} | %{any: String.t()}, range: %{gte: float(), lte: float(), gt: float(), lt: float()}, geo_bounding_box: %{ top_left: %{lat: float(), lon: float()}, bottom_right: %{lat: float(), lon: float()} }, geo_radius: %{center: %{lat: float(), lon: float()}, radius: float()}, values_count: %{ lt: non_neg_integer(), lte: non_neg_integer(), gt: non_neg_integer(), gte: non_neg_integer() } }
@type filter_type() :: [field_condition()] | %{is_empty: map()} | %{has_id: extended_point_id()}
@type get_points_body() :: %{ ids: [non_neg_integer() | String.t()], with_payload: with_payload_interface(), with_vector: boolean() | [String.t()] }
@type hnsw_config() :: %{ m: non_neg_integer() | nil, ef_construct: non_neg_integer() | nil, full_scan_threshold: non_neg_integer() | nil, max_indexing_threads: non_neg_integer() | nil, on_disk: boolean() | nil, payload_m: non_neg_integer() | nil }
@type optimizers_config() :: %{ deleted_threshold: float() | nil, vacuum_min_vector_number: non_neg_integer() | nil, default_segment_number: non_neg_integer() | nil, max_segment_size: non_neg_integer() | nil, memmap_threshold: non_neg_integer() | nil, indexing_threshold: non_neg_integer() | nil, flush_interval_sec: non_neg_integer() | nil, max_optimization_threads: pos_integer() | nil }
@type ordering() :: :weak | :medium | :strong
@type point() :: %{ id: non_neg_integer() | String.t(), vector: [float()], payload: map() }
@type points_batch() :: %{ batch: %{ ids: [non_neg_integer() | String.t()], vectors: vectors(), payloads: [map()] } }
@type points_list() :: %{points: [point()]}
@type recommend_batch_body() :: [recommend_body()]
@type recommend_body() :: %{ positive: extended_point_id(), negative: extended_point_id(), filter: filter_type(), params: search_params(), limit: non_neg_integer(), offset: non_neg_integer(), with_payload: with_payload_interface(), with_vector: boolean() | [String.t()], score_threshold: non_neg_integer() | nil, using: String.t(), lookup_from: %{collection: String.t(), vector: String.t()} | nil }
@type scroll_body() :: %{ offset: non_neg_integer() | String.t(), limit: non_neg_integer(), filter: filter_type(), with_payload: with_payload_interface(), with_vector: boolean() | [String.t()] }
@type search_batch_body() :: [search_request()]
@type search_body() :: %{ vector: vector(), filter: %{must: filter_type(), should: filter_type(), must_not: filter_type()} | nil, params: search_params(), limit: integer(), offset: non_neg_integer(), with_payload: with_payload_interface(), with_vector: boolean() | [String.t()], score_threshold: integer() | nil }
@type search_request() :: %{ vector: vector(), filter: filter_type(), params: search_params(), limit: non_neg_integer(), offset: non_neg_integer(), with_payload: with_payload_interface(), with_vector: boolean() | [String.t()], score_threshold: integer() | nil }
@type set_payload_body() :: %{ payload: map(), points: extended_point_id(), filter: filter_type() }
@type upsert_body() :: points_batch() | points_list()
@type vectors() :: [vector()]
Link to this section Functions
clear_payload(collection_name, body, wait \\ false, ordering \\ nil)
View Source@spec clear_payload( String.t(), [integer() | String.t()], boolean() | nil, ordering() | nil ) :: {:ok, map()} | {:error, any()}
Remove all payload for specified points
path-parameters
Path parameters
- collection_name required : Name of the collection to clear payload from
query-parameters
Query parameters
waitoptional : If true, wait for changes to actually happenorderingoptional : Define ordering guarantees for the operation
request-body-schema
Request body schema
pointsrequired : List of points to clear payload from
@spec count_points(String.t(), %{filter: filter_type(), exact: boolean()}) :: {:ok, map()} | {:error, any()}
Count points which matches given filtering condition
path-parameters
Path parameters
- collection_name required : Name of the collection to count in
request-body-schema
Request body schema
filteroptional : Filter to apply to the search results. Look only for points which satisfies this conditionsexactoptional : If true, count exact number of points. If false, count approximate number of points faster. Approximate count might be unreliable during the indexing process. Default: true
delete_payload(collection_name, body, wait \\ false, ordering \\ nil)
View Source@spec delete_payload( String.t(), delete_payload_body(), boolean() | nil, ordering() | nil ) :: {:ok, map()} | {:error, any()}
Delete specified key payload for points
path-parameters
Path parameters
- collection_name required : Name of the collection to delete from
query-parameters
Query parameters
waitoptional : If true, wait for changes to actually happenorderingoptional : Define ordering guarantees for the operation
request-body-schema
Request body schema
keysrequired : List of payload keys to remove from payloadpointsrequired : Deletes values from each point in this listfilteroptional : Deletes values from points that satisfy this filter condition
delete_points(collection_name, body, wait \\ false, ordering \\ nil)
View Source@spec delete_points(String.t(), delete_body(), boolean() | nil, ordering() | nil) :: {:ok, map()} | {:error, any()}
Delete points
path-parameters
Path parameters
- collection_name required : Name of the collection to update from
query-parameters
Query parameters
waitoptional : If true, wait for changes to actually happenorderingoptional : Define ordering guarantees for the operation
request-body-schema
Request body schema
pointsrequired : List of points to delete
@spec get_point(String.t(), String.t() | non_neg_integer(), consistency() | nil) :: {:ok, map()} | {:error, any()}
Retrieve full information of single point by id.
path-parameters
Path parameters
collection_name required : Name of the collection to update from
id required : ID of the point to retrieve
query-parameters
Query parameters
consistencyoptional : Define read consistency guarantees for the operation
@spec get_points(String.t(), get_points_body(), consistency() | nil) :: {:ok, map()} | {:error, any()}
Retrieve multiple points by specified IDs.
path-parameters
Path parameters
- collection_name required : Name of the collection to update from
query-parameters
Query parameters
consistencyoptional : Define read consistency guarantees for the operation
request-body-schema
Request body schema
idsrequired : List of IDs to retrievewith_payloadoptional : Select which payload to return with the response. Default: Allwith_vectoroptional : Options for specifying which vector to include
overwrite_payload(collection_name, body, wait \\ false, ordering \\ nil)
View Source@spec overwrite_payload( String.t(), set_payload_body(), boolean() | nil, ordering() | nil ) :: {:ok, map()} | {:error, any()}
Replace full payload of points with new one
path-parameters
Path parameters
- collection_name required : Name of the collection to set from
query-parameters
Query parameters
waitoptional : If true, wait for changes to actually happenorderingoptional : Define ordering guarantees for the operation
request-body-schema
Request body schema
payloadrequired : Payload to setpointsrequired : Assigns payload to each point in this listfilteroptional : Assigns payload to each point that satisfy this filter condition
@spec recommend_points(String.t(), recommend_body(), consistency() | nil) :: {:ok, map()} | {:error, any()}
Look for the points which are closer to stored positive examples and at the same time further to negative examples.
path-parameters
Path parameters
- collection_name required : Name of the collection to search in
query-parameters
Query parameters
consistencyoptional : Define read consistency guarantees for the operation
request-body-schema
Request body schema
positiverequired : Look for vectors closest to thosenegativerequired : Look for vectors further from those | Try to avoid vectors like thisfilteroptional : Look only for points which satisfies this conditionsparamsoptional : Additional search parameterslimitrequired : Maximum number of points to returnoffsetoptional : Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.with_payloadoptional : Select which payload to return with the response. Default: Nonewith_vectoroptional : Whether to return the point vector with the result?score_thresholdoptional : 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.usingoptional : Define which vector to use for recommendation, if not specified - try to use default vectorlookup_fromoptional : 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
@spec recommend_points_batch(String.t(), recommend_batch_body(), consistency() | nil) :: {:ok, map()} | {:error, any()}
Request points based on positive and negative examples.
path-parameters
Path parameters
- collection_name required : Name of the collection to search in
query-parameters
Query parameters
consistencyoptional : Define read consistency guarantees for the operation
request-body-schema
Request body schema
searchesrequired : List of searches to perform
@spec scroll_points(String.t(), scroll_body(), consistency() | nil) :: {:ok, map()} | {:error, any()}
Scroll request - paginate over all points which matches given filtering condition
path-parameters
Path parameters
- collection_name required : Name of the collection to retrieve from
query-parameters
Query parameters
consistencyoptional : Define read consistency guarantees for the operation
request-body-schema
Request body schema
offsetoptional : Start ID to read points from.limitoptional : Page size. Default: 10filteroptional : Look only for points which satisfies this conditions. If not provided - all points.with_payloadoptional : Select which payload to return with the response. Default: Allwith_vectoroptional : Options for specifying which vector to include
@spec search_points(String.t(), search_body(), integer() | nil) :: {:ok, map()} | {:error, any()}
Retrieve closest points based on vector similarity and given filtering conditions
path-parameters
Path parameters
- collection_name required : Name of the collection to search in
query-parameters
Query parameters
consistencyoptional : Define read consistency guarantees for the operation
request-body-schema
Request body schema
vectorrequired : Vector to search forfilteroptional : Filter to apply to the search results. Look only for points which satisfies this conditionsparamsoptional : Additional search parameterslimitrequired : Maximum number of points to returnoffsetoptional : Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.with_payloadoptional : Select which payload to return with the response. Default: Nonewith_vectoroptional : Whether to return the point vector with the result?score_thresholdoptional : 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.
@spec search_points_batch(String.t(), search_batch_body(), consistency() | nil) :: {:ok, map()} | {:error, any()}
Retrieve by batch the closest points based on vector similarity and given filtering conditions
path-parameters
Path parameters
- collection_name required : Name of the collection to search in
query-parameters
Query parameters
consistencyoptional : Define read consistency guarantees for the operation
request-body-schema
Request body schema
searchesrequired : List of searches to perform
set_payload(collection_name, body, wait \\ false, ordering \\ nil)
View Source@spec set_payload(String.t(), set_payload_body(), boolean() | nil, ordering() | nil) :: {:ok, map()} | {:error, any()}
Set payload values for points
path-parameters
Path parameters
- collection_name required : Name of the collection to set from
query-parameters
Query parameters
waitoptional : If true, wait for changes to actually happenorderingoptional : Define ordering guarantees for the operation
request-body-schema
Request body schema
payloadrequired : Payload to setpointsrequired : Assigns payload to each point in this listfilteroptional : Assigns payload to each point that satisfy this filter condition
upsert_points(collection_name, body, wait \\ false, ordering \\ nil)
View Source@spec upsert_points(String.t(), upsert_body(), boolean() | nil, ordering() | nil) :: {:ok, map()} | {:error, any()}
Perform insert + updates on points. If point with given ID already exists - it will be overwritten. See more on qdrant
path-parameters
Path parameters
- collection_name required : Name of the collection to update from
query-parameters
Query parameters
waitoptional : If true, wait for changes to actually happenorderingoptional : Define ordering guarantees for the operation
request-body-schema
Request body schema
batchrequired : List of points to insert or update ORpointsrequired : Point to insert or update