标题和描述未使用collective.dexteritytextindexer编制索引

gfo*_*ada 3 indexing plone dexterity

我有很多Dexterity内容类型,其中一些只是容器,只剩下标题和描述(来自plone.app.dexterity.behaviors.metadata.IBasic行为).

我可以通过搜索标题或描述中的文字找到它们.

但对于一些复杂的内容类型我使用collective.dexteritytextindexer来索引更多的字段并且它工作正常,我可以在我标记为要编制索引的字段上找到该文本.

但是标题和说明不再可用于搜索.我尝试过类似的东西:

class IMyContent(form.Schema):
    """My content type description
    """

    dexteritytextindexer.searchable('title')
    dexteritytextindexer.searchable('description')

    dexteritytextindexer.searchable('long_desc')
    form.widget(long_desc = WysiwygFieldWidget)
    long_desc = schema.Text (
            title = _(u"Rich description"),
            description = _(u"Complete description"),
            required = False,
        )
    ...
Run Code Online (Sandbox Code Playgroud)

但是我无法在portal_catalog中的SearchableText列上看到标题和描述的内容,因此结果不会显示它们.

知道我错过了什么吗?

干杯,

小智 5

几乎有同样的问题.关于我使用的http://pypi.python.org/pypi/collective.dexteritytextindexer上的文档

from collective import dexteritytextindexer
from plone.autoform.interfaces import IFormFieldProvider
from plone.directives import form
from zope import schema
from zope.interface import alsoProvides

class IMyBehavior(form.Schema):

    dexteritytextindexer.searchable('specialfield')
    specialfield = schema.TextField(title=u'Special field')

alsoProvides(IMyBehavior, IFormFieldProvider)
Run Code Online (Sandbox Code Playgroud)

将我自己的字段编入索引.但是,代码

from plone.app.dexterity.interfaces import IBasic
from collective.dexteritytextindexer.utils import searchable

searchable(IBasic, 'title')
searchable(IBasic, 'description')
Run Code Online (Sandbox Code Playgroud)

没工作.IBasic的导入失败了.似乎这可以通过导入轻松解决

from plone.app.dexterity.behaviors.metadata import IBasic
Run Code Online (Sandbox Code Playgroud)