@@ -29,18 +29,33 @@ class SearchType(Enum):
2929 ANN = "ANN"
3030
3131
32+ class DistanceMeasure (Enum ):
33+ """Enumerates the types of distance measures that can be used in searches.
34+
35+ Attributes:
36+ COSINE: Cosine similarity measure.
37+ L2_SQUARED: Squared L2 norm (Euclidean) distance.
38+ DOT_PRODUCT: Dot product similarity.
39+ """
40+
41+ COSINE = "cosine"
42+ L2_SQUARED = "l2_squared"
43+ DOT_PRODUCT = "dot_product"
44+
45+
3246@dataclass
3347class QueryOptions :
3448 """Holds configuration options for executing a search query.
3549
3650 Attributes:
3751 num_partitions (Optional[int]): The number of partitions to divide the search space into. None means default partitioning.
38- num_neighbors (Optional[ int] ): The number of nearest neighbors to retrieve. None means use the default .
52+ num_neighbors (int): The number of nearest neighbors to retrieve. Default to 10 .
3953 search_type (SearchType): The type of search algorithm to use. Defaults to KNN.
4054 """
4155
4256 num_partitions : Optional [int ] = None
43- num_neighbors : Optional [int ] = None
57+ num_neighbors : int = 10
58+ distance_measure : DistanceMeasure = DistanceMeasure .L2_SQUARED
4459 search_type : SearchType = SearchType .KNN
4560
4661
@@ -61,20 +76,6 @@ class IndexType(Enum):
6176 TREE_SQ = "TREE_SQ"
6277
6378
64- class DistanceMeasure (Enum ):
65- """Enumerates the types of distance measures that can be used in searches.
66-
67- Attributes:
68- COSINE: Cosine similarity measure.
69- SQUARED_L2: Squared L2 norm (Euclidean) distance.
70- DOT_PRODUCT: Dot product similarity.
71- """
72-
73- COSINE = "cosine"
74- SQUARED_L2 = "squared_l2"
75- DOT_PRODUCT = "dot_product"
76-
77-
7879class VectorIndex :
7980 """Represents a vector index for storing and querying vectors.
8081
0 commit comments