File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 9
9
For the full list of settings and their values, see
10
10
https://docs.djangoproject.com/en/3.2/ref/settings/
11
11
"""
12
-
12
+ import os
13
13
from pathlib import Path
14
14
15
15
# Build paths inside the project like this: BASE_DIR / 'subdir'.
128
128
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
129
129
130
130
HAYSTACK_CONNECTIONS = {
131
- " default" : {
132
- # For Simple:
133
- "ENGINE" : "haystack.backends.simple_backend.SimpleEngine"
131
+ ' default' : {
132
+ 'ENGINE' : 'haystack.backends.whoosh_backend.WhooshEngine' ,
133
+ 'PATH' : os . path . join ( os . path . dirname ( os . path . dirname ( __file__ )), 'Whoosh' ),
134
134
},
135
135
}
Original file line number Diff line number Diff line change 18
18
![ ] ( https://github.com/cs246810/DRFHTutorial/blob/master/api_test.png )
19
19
20
20
结果有点差强人意,确实出现了结果,但是,这里出现的说text为null的数据,显然我没有找到正确的使用drf_haystack
21
- 的方法。
21
+ 的方法。
22
+
23
+ 后来我换上whoosh之后,居然奇迹般的出现了结果。
24
+
25
+ ![ ] ( https://github.com/cs246810/DRFHTutorial/blob/master/whoosh.png )
You can’t perform that action at this time.
0 commit comments