开发者

Problem adding to solr index using Django-Haystack

开发者 https://www.devze.com 2023-02-18 17:05 出处:网络
I\'m trying to index a model in Solr with django-haystack, but it returns me the following error(when using rebuild_index or update_index) :

I'm trying to index a model in Solr with django-haystack, but it returns me the following error(when using rebuild_index or update_index) :

Failed to add documents to Solr: [Reason: ERROR:unknown field 'django_ct']

I followed step by step the "getting started" of Haystack-Search.

I'm using :

  • the latest version of Apache Solr (1.4.1)
  • the latest version of django-haystack

my 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()


开发者_如何学Gosite.register(Entity, EntityIndex)


Be sure your $SOLR_HOME/conf/schema.xml file contains the 'django_ct' field declaration. That is a custom field and needs to be added manually along with any other custom fields you are using.


Try using text = CharField(document

0

精彩评论

暂无评论...
验证码 换一张
取 消