2

在搜索框中输入关键字,比如日光(中文单词),我可以看到提示目标项目的实时搜索结果。它适用于 Products.ATContentTypes (NewsItem, Page) 类型,但无法为我的自定义类型的项目找到相同的关键字。这是该类型的部分代码:

atapi.TextField(
    'history',
    storage=atapi.AnnotationStorage(),
    default_output_type='text/x-html-safe',
    widget=atapi.RichWidget(
        label=_(u"Establishment History"),
        description=_(u"Enter Establishment History."),
        rows = 20,
    ),
),

我确实尝试添加searchable=1,到该字段并重新编目,但仍然没有工作。我错过了什么?

4

1 回答 1

1

将关键字 searchable=True 添加到您的定义中。

atapi.TextField(
    'history',
    searchable=True,
    storage=atapi.AnnotationStorage(),
    default_output_type='text/x-html-safe',
    widget=atapi.RichWidget(
        label=_(u"Establishment History"),
        description=_(u"Enter Establishment History."),
        rows = 20,
    ),
),
于 2012-02-06T14:14:50.740 回答