-
-
Notifications
You must be signed in to change notification settings - Fork 426
/
search.pyi
115 lines (100 loc) · 3.54 KB
/
search.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
from typing import Any
from _typeshed import Self
from django.db.models import Expression, Field
from django.db.models.expressions import Combinable, CombinedExpression, Func
from django.db.models.lookups import Lookup
from typing_extensions import TypeAlias
_Expression: TypeAlias = str | Combinable | SearchQueryCombinable
class SearchVectorExact(Lookup): ...
class SearchVectorField(Field): ...
class SearchQueryField(Field): ...
class SearchConfig(Expression):
config: _Expression | None
def __init__(self, config: _Expression) -> None: ...
@classmethod
def from_parameter(cls, config: _Expression | None) -> SearchConfig: ...
class SearchVectorCombinable:
ADD: str
class SearchVector(SearchVectorCombinable, Func):
config: _Expression | None
function: str
arg_joiner: str
output_field: Field
def __init__(
self, *expressions: _Expression, config: _Expression | None = ..., weight: Any | None = ...
) -> None: ...
class CombinedSearchVector(SearchVectorCombinable, CombinedExpression):
def __init__(
self,
lhs: Combinable,
connector: str,
rhs: Combinable,
config: _Expression | None,
output_field: Field | None = ...,
) -> None: ...
class SearchQueryCombinable:
BITAND: str
BITOR: str
def __or__(self: Self, other: SearchQueryCombinable) -> Self: ...
def __ror__(self: Self, other: SearchQueryCombinable) -> Self: ...
def __and__(self: Self, other: SearchQueryCombinable) -> Self: ...
def __rand__(self: Self, other: SearchQueryCombinable) -> Self: ...
class SearchQuery(SearchQueryCombinable, Func): # type: ignore
SEARCH_TYPES: dict[str, str]
def __init__(
self,
value: _Expression,
output_field: Field | None = ...,
*,
config: _Expression | None = ...,
invert: bool = ...,
search_type: str = ...,
) -> None: ...
def __invert__(self: Self) -> Self: ...
class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression): # type: ignore
def __init__(
self,
lhs: Combinable,
connector: str,
rhs: Combinable,
config: _Expression | None,
output_field: Field | None = ...,
) -> None: ...
class SearchRank(Func):
def __init__(
self,
vector: SearchVector | _Expression,
query: SearchQuery | _Expression,
weights: Any | None = ...,
normalization: Any | None = ...,
cover_density: bool = ...,
) -> None: ...
class SearchHeadline(Func):
function: str
template: str
output_field: Field
def __init__(
self,
expression: _Expression,
query: _Expression,
*,
config: _Expression | None = ...,
start_sel: Any | None = ...,
stop_sel: Any | None = ...,
max_words: int | None = ...,
min_words: int | None = ...,
short_word: str | None = ...,
highlight_all: bool | None = ...,
max_fragments: int | None = ...,
fragment_delimiter: str | None = ...,
) -> None: ...
class TrigramBase(Func):
def __init__(self, expression: _Expression, string: str, **extra: Any) -> None: ...
class TrigramWordBase(Func):
def __init__(self, string: str, expression: _Expression, **extra: Any) -> None: ...
class TrigramSimilarity(TrigramBase): ...
class TrigramDistance(TrigramBase): ...
class TrigramWordDistance(TrigramWordBase): ...
class TrigramStrictWordDistance(TrigramWordBase): ...
class TrigramWordSimilarity(TrigramWordBase): ...
class TrigramStrictWordSimilarity(TrigramWordBase): ...