2
votes

I've set up django with haystack but im having a few problems.

I have a line in my search_indexes.py that says

body = indexes.TextField(model_attr='body')

This corresponds to the line in my models.py that says

body = models.TextField()

Im getting an error when i try and run rebuild_index

body = indexes.TextField(model_attr='body')
AttributeError: 'module' object has no attribute 'TextField'

If i comment out the line in search_indexes.py it adds my documents to the index. How can i fix this?

I have seven videos named "test vid 1" through to "test vid 7". When i search "test" or "vid" they all show up, thats fine. However when i search "6" nothing shows up and when i search "test vid 6" they all show up. It seems like haystack not taking into account the number, any idea why this is?

Thanks

1

1 Answers

2
votes

Error mean TextField does not exists in indexes.

Use indexes.CharField.