-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
45 lines (32 loc) · 916 Bytes
/
models.py
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
from playhouse.sqlite_ext import (
FTS5Model, FTSModel, RowIDField, SearchField, SqliteExtDatabase,
)
db = SqliteExtDatabase(None)
class PeeweeIndex4U(FTSModel):
rowid = RowIDField()
text = SearchField()
source = SearchField(unindexed=True)
class Meta:
database = db
options = {
'tokenize': 'unicode61 "remove_diacritics=2"',
}
class PeeweeIndex4S(FTSModel):
rowid = RowIDField()
text = SearchField()
source = SearchField(unindexed=True)
class Meta:
database = db
class PeeweeIndex5U(FTS5Model):
text = SearchField()
source = SearchField(unindexed=True)
class Meta:
database = db
options = {
'tokenize': 'unicode61 remove_diacritics 2',
}
class PeeweeIndex5S(FTS5Model):
text = SearchField()
source = SearchField(unindexed=True)
class Meta:
database = db