needlestack.collections package¶
Submodules¶
needlestack.collections.collection module¶
-
class
needlestack.collections.collection.Collection[source]¶ Bases:
objectA logical collection made of shards where kNN queries can be performed.
-
name¶ Name of collection
-
shards¶ Dictionary of shard names to shards
-
replication_factor¶ Number of replicas per shard in the cluster
-
enable_id_to_vector¶ Enable retrieving vector from id
-
dimension¶ Dimensionality of the vectors
-
query(X, k, shard_names)[source]¶ - Return type
Iterable[SearchResultItem]
-
retrieve(id, shard_names)[source]¶ - Return type
Optional[RetrievalResultItem]
-
needlestack.collections.shard module¶
-
class
needlestack.collections.shard.Shard[source]¶ Bases:
objectA logical shard containing a index to perform kNN search.
-
name¶ Name of shard
-
weight¶ Weight of shard
-
index¶ BaseIndex for kNN queries
-
enable_id_to_vector¶ Enable retrieving vector from id
-
enable_id_to_vector= False
-
query(X, k)[source]¶ - Return type
List[SearchResultItem]
-