Haystrack rebuild_index Elasticsearch SerializationError

时间:2016-04-13 06:45:15

标签: python django python-3.x elasticsearch django-haystack

我正在创建一个知识库,为了建立搜索系统,我决定将Haystack与Elasticsearch一起使用。我正在使用:

  • Python 3.5
  • Django 1.8.8因为Haystack似乎与Django不兼容 1.9.x
  • Elasticsearch 2.3.0
  • Urllib3
  • Haystack 2.4.1

我按照以下安装步骤操作: django-haystack.readthedocs.org/en/latest/tutorial.html#installation

最后,当我尝试发出命令python3.5 manage.py rebuild_index时,我出现以下错误:

    Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/elasticsearch/serializer.py", line 72, in loads
    deserializer = self.serializers[mimetype]
KeyError: 'text/html'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.5/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.5/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.5/site-packages/haystack/management/commands/rebuild_index.py", line 25, in handle
    call_command('clear_index', **options)
  File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 120, in call_command
    return command.execute(*args, **defaults)
  File "/usr/local/lib/python3.5/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.5/site-packages/haystack/management/commands/clear_index.py", line 56, in handle
    backend.clear(commit=self.commit)
  File "/usr/local/lib/python3.5/site-packages/haystack/backends/elasticsearch_backend.py", line 234, in clear
    self.conn.indices.delete(index=self.index_name, ignore=404)
  File "/usr/local/lib/python3.5/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped
    return func(*args, params=params, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/elasticsearch/client/indices.py", line 200, in delete
    params=params)
  File "/usr/local/lib/python3.5/site-packages/elasticsearch/transport.py", line 353, in perform_request
    data = self.deserializer.loads(data, headers.get('content-type'))
  File "/usr/local/lib/python3.5/site-packages/elasticsearch/serializer.py", line 74, in loads
    raise SerializationError('Unknown mimetype, unable to deserialize: %s' % mimetype)
elasticsearch.exceptions.SerializationError: Unknown mimetype, unable to deserialize: text/html

我不明白!有人可以帮我配置我的搜索系统吗?

0 个答案:

没有答案