pysolr.SolrError:Solr响应错误(HTTP 400):[原因:未定义字段django_ct]

时间:2018-09-20 10:23:55

标签: python django solr django-haystack

我正在尝试使用haystack在Django中实现solr 但面临错误

请帮助

search_indexes.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)
    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())

我做了以下指示:

  1. python manage.py build_solr_schema

  2. python manage.py rebuild_index

错误

raise SolrError(error_message % (resp.status_code, solr_message))
pysolr.SolrError: Solr responded with an error (HTTP 400): [Reason: 
undefined field django_ct]

0 个答案:

没有答案