Forums de discussion

Search Portlet Not Fetching Blog Comments

thumbnail
MANOVINAYAK AYYAPPAN, modifié il y a 12 années.

Search Portlet Not Fetching Blog Comments

Regular Member Publications: 131 Date d'inscription: 13/06/11 Publications récentes
Hi All,

We have a requirement for enabling search for "Comments" section of the blog.

THE REQUIREMENT If a user keys in the a string literal which is part of a comment in blog then the search result should list the blog comments conatining the string Literal entered in the search text box.

We have integrated SOLR into Liferay 6.0.6 and we are able to successfully use the search portlet for searching keywords in blogs, blog tags etc. But the search result does not pull the Comments posted on a blog containing the matching keyword.

The following is what I understood going through liferay Code:
1. The Comments in the Blog Section are stored as MB Messages.
2. MB Messages have Index created during creation of the message. Messages can be created via Message Board portlet or via the Blog Comments Section.
3. I found that the Comments entered via Message Board are indexed using the MBIndexer.java, but the ones entered via the Comments Section in blog are NOT indexed.
4. I was able to fetch the messages containing the keywords entered for search via the SOLR dashboard search http://localhost:8080/solr/admin, by this I confirmed that the Comments in the Message Board section are indexed but the ones that I entered in the blog were NOT appearing.

Another thing that strikes my mind is that the Search capability is tagged at the portlet level and NOT at the Object Level.

I feel I am missing something big or even something simple. Please help me in this regard.

Regards, Mano
thumbnail
Thiago Leão Moreira, modifié il y a 12 années.

RE: Search Portlet Not Fetching Blog Comments

Liferay Legend Publications: 1449 Date d'inscription: 10/10/07 Publications récentes
I'm not completely sure if I understood the problem. Are you asking why Liferay does not bring you the comments in the result? If so this is by design. Liferay brings you just the Blogs that has the comments.
thumbnail
MANOVINAYAK AYYAPPAN, modifié il y a 12 années.

RE: Search Portlet Not Fetching Blog Comments

Regular Member Publications: 131 Date d'inscription: 13/06/11 Publications récentes
Hi Thiago,

Thanks a lot :-) !!! Yes you have understood my problem correctly. Sorry for writing such a lengthy post.

The Comments in the Blog Portlet get stored as MBMessages in the DB, it is the same as Message Board Posts.

But Message Board --> MBMessages are getting indexed, because Search Indexing is at the Portlet level and for MBMessages, this happens via the MBIndexer.java class.

I am trying to find a solution for this problem.

If you have any idea about an approach, please kindly share.

Thanks and Regards,
mano
thumbnail
MANOVINAYAK AYYAPPAN, modifié il y a 12 années.

RE: Search Portlet Not Fetching Blog Comments

Regular Member Publications: 131 Date d'inscription: 13/06/11 Publications récentes
Hi All,

If any one has implemented SOLR search platform in Liferay, please let me know if it is possible to index the "Comments" on a Blog posts just like the way message board comments are indexed during creation.

I tried to replicate the way message board posts are indexed for Comments in the Blog Posts but was unsuccessful to get it indexed.

If anyone has any such similar requirement or any idea on this, please kindly share.

Regards,
Mano
thumbnail
MANOVINAYAK AYYAPPAN, modifié il y a 12 années.

RE: Search Portlet Not Fetching Blog Comments

Regular Member Publications: 131 Date d'inscription: 13/06/11 Publications récentes
Hi All,

I have been doing some study on how the Message Board, Blogs and various other enitities are getting Indexed in Liferay and that How SOLR is fetching these indexed values.


I found the following:
1. All Indexing happens in updateStatus() Method inside the respective LocalServiceImpl class eg. MBMessageLocalServiceImpl
2. The Indexer class is somehow called to get the search keyword using the doGetDocument() Method.

What is really puzzling is the below line of code in MBMessageLocalServiceImpl class:

if (!message.isDiscussion()) {
	indexer.reindex(message); 
}            


I believe A call to indexer.reindex() is how in every ObjectLocalServiceImpl indexes the entity Object while inserting into DB.

But for Blog Comment this is excluded as shown above.

But I tried removing the IF Condition in the above code in an EXT environment. Still was unable to get the Indexing work.

I believe I am missing something big when it comes to Indexing and SOLR search.

Please share your thoughts on this.


Thanks and Regards,
Mano
thumbnail
srikanth a, modifié il y a 12 années.

RE: Search Portlet Not Fetching Blog Comments

Regular Member Publications: 144 Date d'inscription: 21/02/11 Publications récentes
Hi mano,
I don't know whether i properly got your requirement or not but i want to clear you onething is that.
1) The updatestatus in code in MBMessageLocalServiceImpl class is used for the workflow mechanism.
2) The piece of code which you have said above is for the Workflow only which is checking the stage of workflow process and indexing accordingly.


regards
Sri
thumbnail
MANOVINAYAK AYYAPPAN, modifié il y a 12 années.

RE: Search Portlet Not Fetching Blog Comments

Regular Member Publications: 131 Date d'inscription: 13/06/11 Publications récentes
Hi Srikanth,

You are absolutey correct on thisemoticon. Only the Wokflow tiggers the Indexingemoticon.

But the Indexing does not happen for Comments Posted for Blogs.

My Requirement is as follows:
"The Search Portlet should fetch all the blog Comments for any keyword that is searched for "



Regards,
Mano
Harsha Mhaske, modifié il y a 10 années.

RE: Search Portlet Not Fetching Blog Comments

New Member Publications: 15 Date d'inscription: 26/09/08 Publications récentes
Hi,

I have a similar requirement. We are using Liferya comments feature for our custom object.
I want to search the comments so that it shows comment(<countofcommentssearched>) in the left Menu of the search results and results title and short summary on the right side as it does for other Liferay object like bookmarks, blogs etc.

-Harsha
thumbnail
MANOVINAYAK AYYAPPAN, modifié il y a 10 années.

RE: Search Portlet Not Fetching Blog Comments

Regular Member Publications: 131 Date d'inscription: 13/06/11 Publications récentes
Is your Comments as Custom Object or Liferay MbMessage ?

If it is Liferay, and if your version of liferay is 6.1, then you may want to try out Indexer post processor hooks.
If it is custom, then you need to create Index on your own.