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[int], str[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[int], str[str]]], FilterSelector, PointIdsList]) None[source]
delete_payload(keys: Sequence[str], selector: Union[Filter, List[Union[int[int], str[str]]], FilterSelector, PointIdsList]) None[source]
delete_vectors(vectors: Sequence[str], selector: Union[Filter, List[Union[int[int], str[str]]], FilterSelector, PointIdsList]) None[source]
discover(target: Optional[Union[List[float[float]], SparseVector, List[List[float[float]]], int[int], str[str], Document]] = 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[int], str[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[Any, dtype[Union[bool_, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, float128]]], Document]] = 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[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[float]], SparseVector, List[List[float[float]]], int[int], str[str], Document]]] = None, negative: Optional[Sequence[Union[List[float[float]], SparseVector, List[List[float[float]]], int[int], str[str], Document]]] = 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[float]], SparseVector, List[List[float[float]]], int[int], str[str], Document]]] = None, negative: Optional[Sequence[Union[List[float[float]], SparseVector, List[List[float[float]]], int[int], str[str], Document]]] = 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[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[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], Optional[Union[int, str, PointId]]][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, SparseDiscoveryQuery, SparseContextQuery, SparseRecoQuery]], MultiDiscoveryQuery, MultiContextQuery, MultiRecoQuery, Tuple[str, Union[MultiDiscoveryQuery, MultiContextQuery, MultiRecoQuery]], ndarray[Any, dtype[Union[bool_, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, float128]]]], 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[float]], SparseVector, List[List[float[float]]], Document, RecoQuery, SparseRecoQuery, MultiRecoQuery, ndarray[Any, dtype[Union[bool_, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, float128]]]]], NamedVector, NamedSparseVector, RecoQuery, SparseRecoQuery, MultiRecoQuery, ndarray[Any, dtype[Union[bool_, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, float128]]]], 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[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[int], str[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]
ignore_mentioned_ids_filter(query_filter: Optional[Union[Filter, Filter]], mentioned_ids: List[Union[int, str, 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