如上图所示,使用django-haystack
做全文搜索框架,whoosh
做引擎,查询到的数据使用Django的Paginator分页,如果不打印或者不用其他方式迭代分页的所有数据,则会导致最后一页数据重复了倒数第二页的部分数据,并且导致最后的部分数据没有分页。求解决方案。。。
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': os.path.join(BASE_DIR, 'whoosh_index'),
},
}
This has nothing to do with Paginator. It just generates the corresponding sql for you. You should print the relevant sql.
In addition, it is recommended that you use elasticsearch for full-text search