Home  >  Q&A  >  body text

python - Django分页Paginator出现错误

如上图所示,使用django-haystack做全文搜索框架,whoosh做引擎,查询到的数据使用Django的Paginator分页,如果不打印或者不用其他方式迭代分页的所有数据,则会导致最后一页数据重复了倒数第二页的部分数据,并且导致最后的部分数据没有分页。求解决方案。。。

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': os.path.join(BASE_DIR, 'whoosh_index'),
    },
}
伊谢尔伦伊谢尔伦2720 days ago526

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:52:36

    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

    reply
    0
  • Cancelreply