Customize BlogsEntry problems - Indexing and search
来源:互联网 发布:破解游戏的软件 编辑:程序博客网 时间:2024/05/16 09:40
When I customize BlogsEntry by using Ext Plugin. When I add a blog, I don't need to reindex in Liferay 6.0. It automatically does that for us and we can search it successfully. But when it comes to Liferay 6.1, so we need to do reindex when we add or update BlogsEntry.
Here is my codes:
public class BlogsEntryServiceImpl extends BlogsEntryServiceBaseImpl {
@Override
public BlogsEntry addEntry(String title, String description, String content,
int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour,
int displayDateMinute, boolean allowPingbacks, boolean allowTrackbacks,
String[] trackbacks, boolean smallImage, String smallImageURL,
String smallImageFileName, InputStream smallImageInputStream,
ServiceContext serviceContext) throws PortalException, SystemException {
BlogsPermission.check(getPermissionChecker(), serviceContext.getScopeGroupId(),
ActionKeys.ADD_ENTRY);
BlogsEntry entry = BlogsEntryLocalServiceUtil.addEntry(getUserId(), title,
description, content, displayDateMonth, displayDateDay, displayDateYear,
displayDateHour, displayDateMinute, allowPingbacks, allowTrackbacks, trackbacks,
smallImage, smallImageURL, smallImageFileName, smallImageInputStream,
serviceContext);
Indexer indexer = IndexerRegistryUtil.getIndexer(BlogsEntry.class);
indexer.reindex(entry);
return entry;
}
@Override
public BlogsEntry updateEntry(long entryId, String title, String description, String content,
int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour,
int displayDateMinute, boolean allowPingbacks, boolean allowTrackbacks,
String[] trackbacks, boolean smallImage, String smallImageURL,
String smallImageFileName, InputStream smallImageInputStream,
ServiceContext serviceContext) throws PortalException, SystemException {
BlogsEntryPermission.check(getPermissionChecker(), entryId, ActionKeys.UPDATE);
BlogsEntry blogsEntry = blogsEntryLocalService.updateEntry(getUserId(), entryId, title,
description, content, displayDateMonth, displayDateDay, displayDateYear,
displayDateHour, displayDateMinute, allowPingbacks, allowTrackbacks, trackbacks,
smallImage, smallImageURL, smallImageFileName, smallImageInputStream,
serviceContext);
Indexer indexer = IndexerRegistryUtil.getIndexer(BlogsEntry.class);
indexer.reindex(blogsEntry);
return blogsEntry;
}
.....
Make sure we don't need to delete index when we deleteEntry, Liferay takes care of that.
- Customize BlogsEntry problems - Indexing and search
- Liferay Indexing and search
- Solr 开发 I - Installation, Indexing and Search
- Kmeans based indexing and Asymmetric Distance Computation for ANN search (Binary Local Feature): par
- ElasticSearch-Hadoop: Indexing product views count and customer top search query from Hadoop to Elas
- pandas indexing and slicing data
- m3u8 indexing file and HLS
- problems encountered during text search
- Problems encountered during text search
- problems encountered during text search
- Smoking and Dental Problems
- Problems and Opportunities
- U3: Problems and solutions
- Indexing
- indexing
- Customize the file name and saving directory
- Solr: Indexing XML with Lucene and REST
- Database System Concepts (4) -- Indexing and Hashing
- FusionCharts样式总结
- Windows Phone 7 开发 31 日谈——第12日:使手机震动
- Windows Phone 7 开发 31 日谈——第13日:位置服务
- liferay-util:include
- 矩阵相关
- Customize BlogsEntry problems - Indexing and search
- Room Arranger v7 1 2 292 Multilingual Incl Keygen-DJiNN
- Joboshare All Products v1 0 Keygen Only-DJiNN
- PDF ePub DRM Removal v2 10 1 184 Regged-DJiNN
- Android学习笔记02
- jquery省市级联简单例子
- 关闭IE增加安全模式 Window Server 2008R2/2012R2
- HTTP协议详解(还需整理)
- 输出JCFXBL Serlet业务模块信息[JCFXBL环境测试]