Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exclude = .git,__pycache__,venv,.eggs,*.egg,src/typesense/__init__.py
ignore = Q000, WPS602, WPS432, WPS305, WPS221, WPS230, WPS234, WPS433, WPS440, W503, WPS331, WPS306, WPS237, WPS202, RST301, RST306, WPS214, WPS235, WPS226, WPS337, WPS320, F821, WPS201
per-file-ignores =
tests/*.py: S101, WPS226, WPS118, WPS202, WPS204, WPS218, WPS211, WPS604, WPS431, WPS210, WPS201, WPS437
src/typesense/types/*.py: B950, WPS215, WPS111, WPS462, WPS322, WPS428, WPS114, WPS110, WPS202
src/typesense/types/*.py: B950, WPS215, WPS111, WPS462, WPS322, WPS428, WPS114, WPS110, WPS202, WPS115
src/typesense/documents.py: WPS320, E704, D102, WPS428, WPS220
src/typesense/stemming_dictionaries.py: WPS320, E704, D102, WPS428, WPS220
src/typesense/api_call.py: WPS110, WPS211
Expand Down
14 changes: 14 additions & 0 deletions src/typesense/types/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@
Locales = typing.Literal["ja", "zh", "ko", "th", "el", "ru", "rs", "uk", "be", ""]


class HNSWParamsSchema(typing.TypedDict):
"""
The schema for the HNSW parameters in the CollectionFieldSchema.

Attributes:
M (int): The number of bi-directional links created for every new element.
ef_construction (int): The size of the dynamic list for the nearest neighbors.
"""

M: typing.NotRequired[int]
ef_construction: typing.NotRequired[int]


class CollectionFieldSchema(typing.Generic[_TType], typing.TypedDict, total=False):
"""
CollectionFieldSchema represents the schema of a field in a collection.
Expand Down Expand Up @@ -70,6 +83,7 @@ class CollectionFieldSchema(typing.Generic[_TType], typing.TypedDict, total=Fals
symbols_to_index: typing.NotRequired[typing.List[str]]
token_separators: typing.NotRequired[typing.List[str]]
num_dim: typing.NotRequired[float]
hnsw_params: typing.NotRequired[HNSWParamsSchema]
range_index: typing.NotRequired[bool]
index: typing.NotRequired[bool]
vec_dist: typing.NotRequired[typing.Union[typing.Literal["cosine", "ip"], str]]
Expand Down