Django Haystack 文档说:
**Warning**
When you choose a document=True field, it should be consistently named across all of your SearchIndex classes to avoid confusing the backend. The convention is to name this field text.
There is nothing special about the text field name used in all of the examples. It could be anything; you could call it pink_polka_dot and it won’t matter. It’s simply a convention to call it text.
Run Code Online (Sandbox Code Playgroud)
但我不明白这意味着什么.这是他们的示例模型:
从myapp.models import中的haystack导入索引导入datetime
class NoteIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, …Run Code Online (Sandbox Code Playgroud)