Python pysolr.SolrError:Solr响应错误(HTTP 400):[原因:未定义字段django\u ct]
我正在尝试使用haystack在django中实现solr 但是面临着一个错误 请帮忙 搜索索引。py:Python pysolr.SolrError:Solr响应错误(HTTP 400):[原因:未定义字段django\u ct],python,django,solr,django-haystack,Python,Django,Solr,Django Haystack,我正在尝试使用haystack在django中实现solr 但是面临着一个错误 请帮忙 搜索索引。py: import datetime from haystack import indexes from search.models import Note class NoteIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True)
import datetime
from haystack import indexes
from search.models import Note
class NoteIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
author = indexes.CharField(model_attr='user')
pub_date = indexes.DateTimeField(model_attr='pub_date')
def get_model(self):
return Note
def index_queryset(self, using=None):
"""Used when the entire index for model is updated."""
return self.get_model().objects.filter(pub_date__lte=datetime.datetime.now())
我做了以下指示:
raise SolrError(error_message % (resp.status_code, solr_message))
pysolr.SolrError: Solr responded with an error (HTTP 400): [Reason:
undefined field django_ct]
如果你发现了,我对这个解决方案感兴趣:)我很抱歉地告诉你,我从来没有找到使用haystack的解决方案,所以我在没有haystack的情况下实现了solr,我也有同样的问题。有人找到解决办法了吗?