Shortcuts

qdrant_client.local.local_collection module

class LocalCollection(config: CreateCollection, location: Optional[str] = None, force_disable_check_same_thread: bool = False)[source]

Bases: object

LocalCollection is a class that represents a collection of vectors in the local storage.

batch_update_points(update_operations: Sequence[Union[UpsertOperation, DeleteOperation, SetPayloadOperation, OverwritePayloadOperation, DeletePayloadOperation, ClearPayloadOperation, UpdateVectorsOperation, DeleteVectorsOperation]]) None[source]
clear_payload(selector: Union[Filter, list[Union[int, str]], FilterSelector, PointIdsList]) None[source]
close() None[source]
count(count_filter: Optional[Union[Filter, Filter]] = None) CountResult[source]
delete(selector: Union[Filter, list[Union[int, str]], FilterSelector, PointIdsList]) None[source]
delete_payload(keys: Sequence[str], selector: Union[Filter, list[Union[int, str]], FilterSelector, PointIdsList]) None[source]
delete_vectors(vectors: Sequence[str], selector: Union[Filter, list[Union[int, str]], FilterSelector, PointIdsList]) None[source]
discover(target: Optional[Union[List[float], SparseVector, List[List[float]], int, str, Document, Image, InferenceObject]] = None, context: Optional[Sequence[ContextPair]] = None, query_filter: Optional[Union[Filter, Filter]] = None, limit: int = 10, offset: int = 0, with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude, WithPayloadSelector] = True, with_vectors: Union[bool, Sequence[str]] = False, using: Optional[str] = None, lookup_from_collection: Optional[LocalCollection] = None, lookup_from_vector_name: Optional[str] = None, score_threshold: Optional[float] = None) list[ScoredPoint][source]
facet(key: str, facet_filter: Optional[Union[Filter, Filter]] = None, limit: int = 10) FacetResponse[source]
get_vector_params(name: str) VectorParams[source]
info() CollectionInfo[source]
load_vectors() None[source]
overwrite_payload(payload: Dict[str, Any], selector: Union[Filter, list[Union[int, str]], FilterSelector, PointIdsList]) None[source]
query_groups(group_by: str, query: Optional[Union[int, str, PointId, list[float], list[list[float]], SparseVector, NearestQuery, RecommendQuery, DiscoverQuery, ContextQuery, OrderByQuery, FusionQuery, SampleQuery, ndarray[tuple[int, ...], dtype[Union[bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, longdouble]]], Document, Image, InferenceObject]] = None, using: Optional[str] = None, prefetch: Optional[Union[Prefetch, list[Prefetch]]] = None, query_filter: Optional[Union[Filter, Filter]] = None, limit: int = 10, group_size: int = 3, with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude, WithPayloadSelector] = True, with_vectors: Union[bool, Sequence[str]] = False, score_threshold: Optional[float] = None, with_lookup: Optional[Union[str, WithLookup]] = None, with_lookup_collection: Optional[LocalCollection] = None) GroupsResult[source]
query_points(query: Optional[Union[NearestQuery, RecommendQuery, DiscoverQuery, ContextQuery, OrderByQuery, FusionQuery, SampleQuery]] = None, prefetch: Optional[list[Prefetch]] = None, query_filter: Optional[Union[Filter, Filter]] = None, limit: int = 10, offset: int = 0, with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude, WithPayloadSelector] = True, with_vectors: Union[bool, Sequence[str]] = False, score_threshold: Optional[float] = None, using: Optional[str] = None, **kwargs: Any) QueryResponse[source]

Queries points in the local collection, resolving any prefetches first.

Assumes all vectors have been homogenized so that there are no ids in the inputs

recommend(positive: Optional[Sequence[Union[List[float], SparseVector, List[List[float]], int, str, Document, Image, InferenceObject]]] = None, negative: Optional[Sequence[Union[List[float], SparseVector, List[List[float]], int, str, Document, Image, InferenceObject]]] = None, query_filter: Optional[Union[Filter, Filter]] = None, limit: int = 10, offset: int = 0, with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude, WithPayloadSelector] = True, with_vectors: Union[bool, Sequence[str]] = False, score_threshold: Optional[float] = None, using: Optional[str] = None, lookup_from_collection: Optional[LocalCollection] = None, lookup_from_vector_name: Optional[str] = None, strategy: Optional[RecommendStrategy] = None) list[ScoredPoint][source]
recommend_groups(group_by: str, positive: Optional[Sequence[Union[List[float], SparseVector, List[List[float]], int, str, Document, Image, InferenceObject]]] = None, negative: Optional[Sequence[Union[List[float], SparseVector, List[List[float]], int, str, Document, Image, InferenceObject]]] = None, query_filter: Optional[Filter] = None, limit: int = 10, group_size: int = 1, score_threshold: Optional[float] = None, with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude] = True, with_vectors: Union[bool, Sequence[str]] = False, using: Optional[str] = None, lookup_from_collection: Optional[LocalCollection] = None, lookup_from_vector_name: Optional[str] = None, with_lookup: Optional[Union[str, WithLookup]] = None, with_lookup_collection: Optional[LocalCollection] = None, strategy: Optional[RecommendStrategy] = None) GroupsResult[source]
retrieve(ids: Sequence[Union[int, str, PointId]], with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude, WithPayloadSelector] = True, with_vectors: Union[bool, Sequence[str]] = False) list[Record][source]
scroll(scroll_filter: Optional[Union[Filter, Filter]] = None, limit: int = 10, order_by: Optional[Union[str, OrderBy, OrderBy]] = None, offset: Optional[Union[int, str, PointId]] = None, with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude, WithPayloadSelector] = True, with_vectors: Union[bool, Sequence[str]] = False) tuple[list[Record], Union[int, str, points_pb2.PointId, NoneType]][source]
search(query_vector: Union[list[float], tuple[str, list[float]], list[list[float]], tuple[str, list[list[float]]], NamedVector, NamedSparseVector, DiscoveryQuery, ContextQuery, RecoQuery, tuple[str, Union[DiscoveryQuery, ContextQuery, RecoQuery]], SparseVector, SparseDiscoveryQuery, SparseContextQuery, SparseRecoQuery, tuple[str, Union[SparseVector, qdrant_client.local.sparse_distances.SparseDiscoveryQuery, qdrant_client.local.sparse_distances.SparseContextQuery, qdrant_client.local.sparse_distances.SparseRecoQuery]], MultiDiscoveryQuery, MultiContextQuery, MultiRecoQuery, tuple[str, Union[qdrant_client.local.multi_distances.MultiDiscoveryQuery, qdrant_client.local.multi_distances.MultiContextQuery, qdrant_client.local.multi_distances.MultiRecoQuery]], ndarray[tuple[int, ...], dtype[Union[bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, longdouble]]]], query_filter: Optional[Union[Filter, Filter]] = None, limit: int = 10, offset: Optional[int] = None, with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude, WithPayloadSelector] = True, with_vectors: Union[bool, Sequence[str]] = False, score_threshold: Optional[float] = None) list[ScoredPoint][source]
search_groups(query_vector: Union[Sequence[float], list[list[float]], tuple[str, Union[List[float], SparseVector, List[List[float]], Document, Image, InferenceObject, RecoQuery, qdrant_client.local.sparse_distances.SparseRecoQuery, qdrant_client.local.multi_distances.MultiRecoQuery, numpy.ndarray[tuple[int, ...], numpy.dtype[Union[numpy.bool, numpy.int8, numpy.int16, numpy.int32, numpy.int64, numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64, numpy.float16, numpy.float32, numpy.float64, numpy.longdouble]]]]], NamedVector, NamedSparseVector, RecoQuery, SparseRecoQuery, MultiRecoQuery, ndarray[tuple[int, ...], dtype[Union[bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, longdouble]]]], group_by: str, query_filter: Optional[Filter] = None, limit: int = 10, group_size: int = 1, with_payload: Union[bool, Sequence[str], PayloadSelectorInclude, PayloadSelectorExclude] = True, with_vectors: Union[bool, Sequence[str]] = False, score_threshold: Optional[float] = None, with_lookup: Optional[Union[str, WithLookup]] = None, with_lookup_collection: Optional[LocalCollection] = None) GroupsResult[source]
search_matrix_offsets(query_filter: Optional[Union[Filter, Filter]] = None, limit: int = 3, sample: int = 10, using: Optional[str] = None) SearchMatrixOffsetsResponse[source]
search_matrix_pairs(query_filter: Optional[Union[Filter, Filter]] = None, limit: int = 3, sample: int = 10, using: Optional[str] = None) SearchMatrixPairsResponse[source]
set_payload(payload: Dict[str, Any], selector: Union[Filter, list[Union[int, str]], FilterSelector, PointIdsList], key: Optional[str] = None) None[source]
update_sparse_vectors_config(vector_name: str, new_config: SparseVectorParams) None[source]
update_vectors(points: Sequence[PointVectors]) None[source]
upsert(points: Union[Sequence[PointStruct], Batch]) None[source]
LARGE_DATA_THRESHOLD = 20000
ignore_mentioned_ids_filter(query_filter: Optional[Union[Filter, Filter]], mentioned_ids: list[Union[int, str, points_pb2.PointId]]) Union[Filter, Filter][source]
record_to_scored_point(record: Record) ScoredPoint[source]
set_prefetch_limit_recursively(prefetch: Prefetch, limit: int) Prefetch[source]
to_jsonable_python(x: Any) Any[source]

Qdrant

Learn more about Qdrant vector search project and ecosystem

Discover Qdrant

Similarity Learning

Explore practical problem solving with Similarity Learning

Learn Similarity Learning

Community

Find people dealing with similar problems and get answers to your questions

Join Community