Websorl 在构建架构时返回错误" unknown field 'django_ct' ".xml



我们的网站运行在Python 3.6.5和

  • 姜戈==1.11.20
  • 姜戈干草堆==2.8.1
  • 证书==0.0.8
  • urllib3<1.25,>=1.21.1
  • Pysolr==3.8.1

我用django-haystack(python manage.py build_solr_schema>schema.xml(生成了schema.xml并将其粘贴到websolr(heroku版本(中。

当我运行以下命令时:

heroku run python manage.py rebuild_index --app terradiem

我收到以下错误:

无法将文档添加到 Solr:Solr 响应错误 (HTTP 400(:[原因:错误:[doc=naturalearth.naturalearthmerged.12001] 未知字段"django_ct"]

回溯(最近一次调用(: 文件"/app/.heroku/python/lib/python3.6/site-packages/haystack/backends/solr_backend.py",第 72 行,更新中 self.conn.add(docs, commit=commit, boost=index.get_field_weights(((

文件 "/app/.heroku/python/lib/python3.6/site-packages/pysolr.py",第 918 行,在添加 覆盖=覆盖,处理程序=处理程序(

文件 "/app/.heroku/python/lib/python3.6/site-packages/pysolr.py",第 500 行,_update

返回 self._send_request('post', path, message, {'Content-type': 'text/xml; charset=utf-8'}(

文件 "/app/.heroku/python/lib/python3.6/site-packages/pysolr.py",第 412 行,_send_request 提高求解误差(error_message % (resp.status_code, solr_message(( 皮索尔。SolrError:Solr响应错误(HTTP 400(:[原因:错误:[doc=naturalearth.naturalearthmerged.12001]未知字段'django_ct']

我想它与架构中的以下行有关.xml:

<field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="django_ct" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="django_id" type="string" indexed="true" stored="true" multiValued="false"/>

有什么线索吗?

我无法让它与Solr一起使用。

如果它对其他人有用,以下是我设法让Django&Heroku使用django-haystack的方法:

我切换到Heroku Bonsai和ElasticSearch。

版本组合非常复杂,因为Haystack尚不支持Elasticsearch 5.x,6.x或7.x,而多租户的Bonsai计划仅支持版本5.4.3/6.5.4/7.2.0

因此,我安装了一个支持 ElasticSearch 5 的 django-haystack 分支: https://github.com/tehamalab/django-haystack-es

并在 Heroku 中创建了插件,如下所示:

heroku addons:create bonsai:staging -a terradiem --version=5.6.16

现在一切都很好。

相关内容

最新更新