0

I am using haystack and elasticsearch. I am building indexes in the following manner-->

class BookIndex(indexes.SearchIndex,indexes.Indexable):

    text= indexes.CharField(document=True,use_template=True)
    content_auto = indexes.EdgeNgramField(model_attr='title',boost=1.5)
    isbn_13 = indexes.CharField(model_attr='isbn_13')
    category = indexes.CharField()
    sub_category = indexes.CharField()

def prepare_sellers(self, Book):
    return [seller.name for seller in Book.sellers.all()]


def prepare_category(self, Book):
    return [Book.category.name]

def prepare_sub_category(self, Book):
    return [Book.sub_category.name]

And I have included the following in the settings file :-

HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'

But when I am going to add data to my database by doing -> http://dpaste.com/01739SW , haystack index updating is failing and I am getting the following error-->http://dpaste.com/2YGXZ8J

Can someone please help me out in fixing the issue. Thank you.

Subhajit
  • 361
  • 1
  • 4
  • 18
  • Are you sure that the category of book instance != None – vadimchin Jan 08 '16 at 06:21
  • Yes, I am sure about that! If i remove `HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor` then add the book and update index manually then it is working fine – Subhajit Jan 08 '16 at 10:27
  • For test - you can get BaseSignalProcessor, and call directly handle_save, in model save method. If no errors - http://stackoverflow.com/questions/19706083/django-haystack-indexing-is-not-working-for-many-to-many-field-in-model - same problem – vadimchin Jan 08 '16 at 12:39

0 Answers0