Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python pysolr.SolrError:Solr响应错误(HTTP 400):[原因:未定义字段django\u ct]_Python_Django_Solr_Django Haystack - Fatal编程技术网

Python pysolr.SolrError:Solr响应错误(HTTP 400):[原因:未定义字段django\u ct]

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)

我正在尝试使用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)
    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())
我做了以下指示:

  • python manage.py build\u solr\u模式

  • python manage.py重建索引

  • 错误

    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,我也有同样的问题。有人找到解决办法了吗?