在Liferay 6.1中搜索动态数据列表记录的最佳方法 [英] Best way to include Dynamic Data List Records in search in Liferay 6.1

查看:416
本文介绍了在Liferay 6.1中搜索动态数据列表记录的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Liferay 6.2中,可以在动态数据列表定义的字段上设置可索引选项,从而使它们可搜索(如Liferay 6.2的文档中所述

In Liferay 6.2 it is possible to set the Indexable option on fields of Dynamic Data List Definitions, thereby making them searchable (as explained in the Documentation for Liferay 6.2)

我想在搜索中包含DDL记录并且必须使用Liferay 6.1。我想知道,最好的方法是什么。

I want to include DDL records in my search and have to use Liferay 6.1. I am wondering, what would be the best way to go about this.

现在我已经研究过自定义搜索,但动态数据列表不是在那里作为一个选项提到。

Right now I have looked into customizing the search, but Dynamic Data Lists are not being mentioned there as an option.

我也看了创建一个Indexer Post-Processor挂钩,但如果我理解正确,它只能够改变现有的索引流程。

I also looked at Creating an Indexer Post-Processor hook, but if I understand this correctly, it is only able to alter existing indexing processes.

似乎可以为自定义资产创建索引器,但我想知道这是否是最好的方法,因为这个过程可能非常耗时,我不知道是否同样适用于定制资产的过程也是如此一般情况下动态数据列表的rks。

It does seem possible to create Indexers for custom assets, but I wonder if this is the best way to go as the process is probably very time consuming and I don't know if the same process that is applicable to custom assets also works for Dynamic Data Lists in general.

有没有更简单的方法在Liferay 6.1中实现可搜索的动态数据列表(如6.2),我只是没有看到?

Is there an easier way to achieve searchable Dynamic Data Lists in Liferay 6.1 (like in 6.2) that I am just not seeing?

推荐答案

我找不到任何< indexer-class> 声明liferay-portlet.xml中的动态数据portlet定义。因此,您需要创建一个EXT插件,其中包含1)用于DDL记录的Indexer类,以及2)使用更新的liferay-portlet.xml< indexer-class> 对于Portlet 169.成功完成此操作后,您必须按照此页面,并添加 com.liferay.portlet.dynamicdatamapping.model.DDMContent 在下面的列表中:

I could not find <indexer-class> declaration in any Dynamic Data portlet definitions in liferay-portlet.xml. So, you will need to create an EXT plugin that has 1) an Indexer class for DDL record through and 2) liferay-portlet.xml updated with <indexer-class> for Portlet 169. After you have successfully achieved this, you will have to update your Search portlet's display settings as explained on this page, and add com.liferay.portlet.dynamicdatamapping.model.DDMContent in the below list:

{"facets": [
{
    "className": "com.liferay.portal.kernel.search.facet.AssetEntriesFacet",
    "data": {
        "frequencyThreshold": 1,
        "values": [
            "com.liferay.portlet.bookmarks.model.BookmarksEntry",
            "com.liferay.portlet.blogs.model.BlogsEntry",
            "com.liferay.portlet.calendar.model.CalEvent",
            "com.liferay.portlet.documentlibrary.model.DLFileEntry",
            "com.liferay.portlet.journal.model.JournalArticle",
            "com.liferay.portlet.messageboards.model.MBMessage",
            "com.liferay.portlet.wiki.model.WikiPage",
            "com.liferay.portal.model.User",
        "com.liferay.portlet.dynamicdatamapping.model.DDMContent"
        ]
    },
...
...

这是高级方法。你需要从这里连接点。希望这会有所帮助!

This is high-level approach. You'll need to connect the dots from here. Hope this helps!

(如果你想知道为什么不使用hook呢?原因:因为钩子不支持覆盖liferay-portlet.xml,如上所述< a href =https://issues.liferay.com/browse/LPS-15760\"rel =nofollow>这里)

(If you're wondering why not use hook instead? Reason: Because hooks don't support overriding liferay-portlet.xml yet, as mentioned here)

这篇关于在Liferay 6.1中搜索动态数据列表记录的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆