Django 2.0干草堆飞快移动更新索引,重建索引抛出错误 [英] Django 2.0 haystack whoosh update index, rebuild index throw error

查看:96
本文介绍了Django 2.0干草堆飞快移动更新索引,重建索引抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将django 2.0与haystack + whoosh一起用作搜索。我按照文档中的说明进行配置。发生的问题是当我运行 ./ manage.py rebuild_index 时显示此错误:

I am using django 2.0 with haystack+whoosh as a search. I configured as it is said in the documentation. Occurred problem is when i run ./manage.py rebuild_index it shows this error:

Traceback (most recent call last):
  File "./manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/management/commands/rebuild_index.py", line 36, in handle
    call_command('clear_index', **options)
  File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/__init__.py", line 133, in call_command
    ', '.join(sorted(valid_options)),
TypeError: Unknown option(s) for clear_index command: batchsize, workers. Valid options are: commit, help, interactive, no_color, nocommit, noinput, pythonpath, settings, skip_checks, stderr, stdout, traceback, using, verbosity, version.

之后,我尝试了 update_index 这个错误:

after that i tried update_index it shows me this error:

File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 214, in handle self.update_backend(label, using)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 257, in update_backend
commit=self.commit, max_retries=self.max_retries)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 84, in do_update
backend.update(index, current_qs, commit=commit)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/backends/whoosh_backend.py", line 185, in update
doc = index.full_prepare(obj)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/indexes.py", line 208, in full_prepare
self.prepared_data = self.prepare(obj)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/indexes.py", line 199, in prepare
self.prepared_data[field.index_fieldname] = field.prepare(obj)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/fields.py", line 205, in prepare
return self.convert(super(CharField, self).prepare(obj))
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/fields.py", line 88, in prepare
values = self.resolve_attributes_lookup(current_objects, attrs)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/fields.py", line 131, in resolve_attributes_lookup
values.append(current_object())
TypeError: __call__() missing 1 required keyword-only argument: 'manager'

那么有人遇到过这个错误吗?它是否与django 2.0有关,因为我管理它与django 1.11兼容。

So has anyone faced this error? Is it related to django 2.0 because i managed it work well with django 1.11.

推荐答案

您安装的Haystack安装版本不支持Django。 2.0。在3月发布的 Haystack 2.8 中添加了对Django 2.0的支持。 2018。

Your installed version of Haystack does not support Django 2.0. Support for Django 2.0 was added in Haystack 2.8, which was released in March 2018.

这篇关于Django 2.0干草堆飞快移动更新索引,重建索引抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆