toastdriven/django-haystack — Issue #465: Field not being found by backend
Author: octaflop
Created: 2011-12-23 04:24:56+00:00
State: open

I'm getting the following when I run `./manage.py rebuild_index`

haystack/backends/whoosh_backend.py", line 165, in build_schema raise SearchBackendError("No fields were found in any search_indexes. Please correct this before attempting to search.")
haystack.exceptions.SearchBackendError: No fields were found in any search_indexes. Please correct this before attempting to search.

I'm on haystack v2.0.0 and here is the search_indexes.py file in the app directory in question:

```python
from haystack import indexes

class MemberIndex(indexes.SearchIndex, indexes.Indexable): # google tells me that this is usually where the problem occurs
text = indexes.CharField(document=True, use_template=True)
agency = indexes.CharField(model_attr='agency')
site_updated = indexes.DateTimeField(model_attr='site_updated')

def get_model(self):
from memdir.models import Member # or else a circular import occurs
return Member

def index_queryset(self):
""" Used when entire index is updated """
return self.get_model().objects.all()
```

for reference, here is `./manage.py haystack_info`'s output:

````
Number of handled 0 index(es).
````

Am I doing something wrong with the index? When I tried haystack v1.2.6 I had issues with the model import and I'm trying v2.0.0-latest (from git) to try to fix this. Whoosh is v2.1.0.