我正在尝试使用 django-haystack 为 Solr 中的模型建立索引,但它返回了以下错误(使用rebuild_index 或 update_index 时):
Failed to add documents to Solr: [Reason: ERROR:unknown field 'django_ct']
我一步一步跟着 Haystack-Search 的“入门”。
我正在使用 :
- 最新版本的 Apache Solr (1.4.1)
- 最新版本的 django-haystack
我的 search_indexes.py :
from haystack.indexes import *
from haystack import site
from models import Entity
class EntityIndex(SearchIndex):
name = CharField(document=True)
def get_queryset(self):
return Entity.objects.all()
site.register(Entity, EntityIndex)