更改Liferay搜索索引器 [英] Change Liferay Search Indexer

查看:163
本文介绍了更改Liferay搜索索引器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想覆盖索引器的功能,我发现索引器是在liferay-portlet.xml中定义的,所以我不能覆盖索引器,除非我更改了服务器上的文件这是一个不好的做法,那么我还能以一种好的方式改变索引器吗?

I want to override the functionality of an indexer and what I found was that the indexer is defined in the liferay-portlet.xml and so I cannot override the indexer unless I changed the file on the server which is a bad practice, so is there anyway I can change the indexer in a good manner ??

推荐答案

如果你使用6.0或更高版本,你可以使用hook插件更改文档索引的方式。

If you are using 6.0 or higher, you can change the way a document is indexed by using a hook plugin.

只需在 liferay-hook.xml中定义

<indexer-post-processor>
    <indexer-class-name>com.liferay.portal.model.User</indexer-class-name>
    <indexer-post-processor-impl>com.example.hook.indexer.UserIndexerPostProcessor</indexer-post-processor-impl>
</indexer-post-processor>

在后处理器类中,扩展 com.liferay.portal.kernel.search .BaseIndexerPostProcessor 并实现你需要更改的方法。

In your post processor class extend com.liferay.portal.kernel.search.BaseIndexerPostProcessor and implement the method you need to change up.

这篇关于更改Liferay搜索索引器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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