Я следую инструкциям на haystack documentation.Джанго-стог не индексировать мои данные
Я не получаю никаких результатов для SearchQuerySet(). Все().
Я думаю, что проблема здесь
$ ./manage.py rebuild_index
WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'.
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
All documents removed.
Indexing 0 notes. // <-- here 0 notes!
MySite/примечание/search_indexes.py выглядит
import datetime
import haystack
from haystack import indexes
from note.models import Note
class NoteIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
author = indexes.CharField(model_attr='user')
pub_date = indexes.DateTimeField(model_attr='pub_date')
def get_model(self):
return Note
def index_queryset(self):
"""Used when the entire index for model is updated."""
return self.get_model().objects.filter(pub_date__lte=datetime.datetime.now())
и я MySite/примечание/шаблоны/поиск/индексов/примечание/Note_text. TXT
{{ object.title }}
{{ object.user.get_full_name }}
{{ object.body }}
Debugging haystack document упоминает
У вас есть search_sites.py, который запускает haystack.autodiscover?
Вы зарегистрировали свои модели на основном haystack.site (обычно в пределах вашего search_indexes.py)?
Но ни одна из search_sites.py, haystack.autodiscover, haystack.site не упоминалась в первой статье.
Я так смущен. Разве их документы касаются разных версий сена?
Мои расстановок являются ..
стог версия 2.0.0.beta
Джанго 1.3.1
Solr 3.6.0
SQLite 3
В моем (глупом) случае rebuild_index не получил индекс никаких продуктов, потому что не было (соединение db было неправильным). –