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 99For the full list of settings and their values, see
1010https://docs.djangoproject.com/en/3.2/ref/settings/
1111"""
12-
12+ import os
1313from pathlib import Path
1414
1515# Build paths inside the project like this: BASE_DIR / 'subdir'.
128128DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
129129
130130HAYSTACK_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' ),
134134 },
135135}
Original file line number Diff line number Diff line change 1818![ ] ( https://github.com/cs246810/DRFHTutorial/blob/master/api_test.png )
1919
2020结果有点差强人意,确实出现了结果,但是,这里出现的说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