链接到说明
我正在按照http://read-the-docs.readthedocs.org/en/latest/install.html#solr-search-setup上的说明进行操作
问题
目前,我可以设置 readthedocs.org 的本地实例;但是,我无法正确设置搜索,因为我似乎无法通过运行以下命令生成必要的 schema.xml 文件。其中的上下文在上面的链接中。
./manage.py build_solr_schema > $SOLR_PATH/solr/conf/schema.xml
我没有成功生成 schema.xml,而是出现了这个错误。
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/home/***/ford-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/***/ford-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/***/ford-env/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/***/ford-env/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/***/ford-env/local/lib/python2.7/site-packages/haystack/management/commands/build_solr_schema.py", line 26, in handle
schema_xml = self.build_template(using=using)
File "/home/***/ford-env/local/lib/python2.7/site-packages/haystack/management/commands/build_solr_schema.py", line 52, in build_template
c = self.build_context(using=using)
File "/home/***/ford-env/local/lib/python2.7/site-packages/haystack/management/commands/build_solr_schema.py", line 38, in build_context
raise ImproperlyConfigured("'%s' isn't configured as a SolrEngine)." % backend.connection_alias)
我猜有一个额外的步骤涉及在生成 xml 之前使用 django 配置 solr。类似的错误建议编辑 settings.py 文件,但我似乎无法在项目目录中找到一个。由于我对 django 不熟悉,我不知道如何从这里继续。