Skip to content

Commit

Permalink
fix: remove updates which are too early for the time
Browse files Browse the repository at this point in the history
  • Loading branch information
joein committed Sep 13, 2024
1 parent 8ca17ad commit 8ebdc4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 184 deletions.
136 changes: 0 additions & 136 deletions qdrant_client/http/api/points_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,74 +757,6 @@ def _build_for_search_points(
content=body,
)

def _build_for_search_points_matrix_offsets(
self,
collection_name: str,
consistency: m.ReadConsistency = None,
timeout: int = None,
search_matrix_request: m.SearchMatrixRequest = None,
):
"""
Retrieve distance matrix with an offset based output format
"""
path_params = {
"collection_name": str(collection_name),
}

query_params = {}
if consistency is not None:
query_params["consistency"] = str(consistency)
if timeout is not None:
query_params["timeout"] = str(timeout)

headers = {}
body = jsonable_encoder(search_matrix_request)
if "Content-Type" not in headers:
headers["Content-Type"] = "application/json"
return self.api_client.request(
type_=m.InlineResponse20023,
method="POST",
url="/collections/{collection_name}/points/search/matrix/offsets",
headers=headers if headers else None,
path_params=path_params,
params=query_params,
content=body,
)

def _build_for_search_points_matrix_pairs(
self,
collection_name: str,
consistency: m.ReadConsistency = None,
timeout: int = None,
search_matrix_request: m.SearchMatrixRequest = None,
):
"""
Retrieve distance matrix with a pair based output format
"""
path_params = {
"collection_name": str(collection_name),
}

query_params = {}
if consistency is not None:
query_params["consistency"] = str(consistency)
if timeout is not None:
query_params["timeout"] = str(timeout)

headers = {}
body = jsonable_encoder(search_matrix_request)
if "Content-Type" not in headers:
headers["Content-Type"] = "application/json"
return self.api_client.request(
type_=m.InlineResponse20022,
method="POST",
url="/collections/{collection_name}/points/search/matrix/pairs",
headers=headers if headers else None,
path_params=path_params,
params=query_params,
content=body,
)

def _build_for_set_payload(
self,
collection_name: str,
Expand Down Expand Up @@ -1282,40 +1214,6 @@ async def search_points(
search_request=search_request,
)

async def search_points_matrix_offsets(
self,
collection_name: str,
consistency: m.ReadConsistency = None,
timeout: int = None,
search_matrix_request: m.SearchMatrixRequest = None,
) -> m.InlineResponse20023:
"""
Retrieve distance matrix with an offset based output format
"""
return await self._build_for_search_points_matrix_offsets(
collection_name=collection_name,
consistency=consistency,
timeout=timeout,
search_matrix_request=search_matrix_request,
)

async def search_points_matrix_pairs(
self,
collection_name: str,
consistency: m.ReadConsistency = None,
timeout: int = None,
search_matrix_request: m.SearchMatrixRequest = None,
) -> m.InlineResponse20022:
"""
Retrieve distance matrix with a pair based output format
"""
return await self._build_for_search_points_matrix_pairs(
collection_name=collection_name,
consistency=consistency,
timeout=timeout,
search_matrix_request=search_matrix_request,
)

async def set_payload(
self,
collection_name: str,
Expand Down Expand Up @@ -1722,40 +1620,6 @@ def search_points(
search_request=search_request,
)

def search_points_matrix_offsets(
self,
collection_name: str,
consistency: m.ReadConsistency = None,
timeout: int = None,
search_matrix_request: m.SearchMatrixRequest = None,
) -> m.InlineResponse20023:
"""
Retrieve distance matrix with an offset based output format
"""
return self._build_for_search_points_matrix_offsets(
collection_name=collection_name,
consistency=consistency,
timeout=timeout,
search_matrix_request=search_matrix_request,
)

def search_points_matrix_pairs(
self,
collection_name: str,
consistency: m.ReadConsistency = None,
timeout: int = None,
search_matrix_request: m.SearchMatrixRequest = None,
) -> m.InlineResponse20022:
"""
Retrieve distance matrix with a pair based output format
"""
return self._build_for_search_points_matrix_pairs(
collection_name=collection_name,
consistency=consistency,
timeout=timeout,
search_matrix_request=search_matrix_request,
)

def set_payload(
self,
collection_name: str,
Expand Down
48 changes: 0 additions & 48 deletions qdrant_client/http/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,19 +952,6 @@ class InlineResponse20021(BaseModel):
status: Optional[str] = Field(default=None, description="")
result: Optional[List["QueryResponse"]] = Field(default=None, description="")


class InlineResponse20022(BaseModel):
time: Optional[float] = Field(default=None, description="Time spent to process this request")
status: Optional[str] = Field(default=None, description="")
result: Optional["SearchMatrixPairsResponse"] = Field(default=None, description="")


class InlineResponse20023(BaseModel):
time: Optional[float] = Field(default=None, description="Time spent to process this request")
status: Optional[str] = Field(default=None, description="")
result: Optional["SearchMatrixOffsetsResponse"] = Field(default=None, description="")


class InlineResponse2003(BaseModel):
time: Optional[float] = Field(default=None, description="Time spent to process this request")
status: Optional[str] = Field(default=None, description="")
Expand Down Expand Up @@ -1999,41 +1986,6 @@ class SearchGroupsRequest(BaseModel, extra="forbid"):
)


class SearchMatrixOffsetsResponse(BaseModel):
offsets_row: List[int] = Field(..., description="Row coordinates of the CRS matrix")
offsets_col: List[int] = Field(..., description="Column coordinates ids of the matrix")
scores: List[float] = Field(..., description="Scores associate with coordinates")
ids: List["ExtendedPointId"] = Field(..., description="Ids of the points in order")


class SearchMatrixPair(BaseModel):
"""
Pair of points (a, b) with score
"""

a: "ExtendedPointId" = Field(..., description="Pair of points (a, b) with score")
b: "ExtendedPointId" = Field(..., description="Pair of points (a, b) with score")
score: float = Field(..., description="Pair of points (a, b) with score")


class SearchMatrixPairsResponse(BaseModel):
pairs: List["SearchMatrixPair"] = Field(..., description="List of pairs of points with scores")


class SearchMatrixRequest(BaseModel, extra="forbid"):
shard_key: Optional["ShardKeySelector"] = Field(
default=None,
description="Specify in which shards to look for the points, if not specified - look in all shards",
)
filter: Optional["Filter"] = Field(default=None, description="Look only for points which satisfies this conditions")
sample: int = Field(..., description="How many points to select and search within.")
limit: int = Field(..., description="How many neighbours per sample to find")
using: Optional[str] = Field(
default=None,
description="Define which vector name to use for querying. If missing, the default vector is used.",
)


class SearchParams(BaseModel, extra="forbid"):
"""
Additional parameters of the search
Expand Down

0 comments on commit 8ebdc4c

Please sign in to comment.