Plone 中的自定义 SearchableText 和 HTML 字段
我正在编写一个 Dexterity 内容类型,其中包含纯文本和 HTML 字段。我想要一个自定义的 SearchableText() 方法,它将这些字段公开给 Portal_catalog 和 Plone 全文搜索。
我假设对于纯文本我可以用空格进行字符串连接。但是,在 SearchableText() 中公开 HTML 内容时,我应该如何预处理它呢?
I am writing a Dexterity content type which contains plain text and HTML fields. I want to have a custom SearchableText() method which exposes these fields to portal_catalog and Plone full text search.
I assume for plain text I can just do string join with spaces. But how I should preprocess HTML content when exposing it in SearchableText()?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了在 plone 中转换数据,有一个名为 Portal_transforms 的工具,它在转换内容方面非常智能(根据您的操作系统/安装,它也可能能够转换 .doc、.pdf 等):
为了灵活地索引字段,我建议使用collective.dexteritytextindexer(但目前没有TTW支持)。
-> http://pypi.python.org/pypi/collective.dexteritytextindexer
-> https://github.com/collective/collective.dexteritytextindexer
干杯
for converting data in plone there is a tool called portal_transforms, which is quite intelligent in converting stuff (depending on your os / installation it may also be able to convert .doc, .pdf etc.):
for indexing fields in dexterity I propose to use collective.dexteritytextindexer (but there is no TTW support at the moment).
-> http://pypi.python.org/pypi/collective.dexteritytextindexer
-> https://github.com/collective/collective.dexteritytextindexer
cheers
也许 collective.dexteritytextindexer 可以帮助您获得您想要的部分内容。
Maybe collective.dexteritytextindexer can help you to get part of what you want.