RE: Search portlets

940514, modificat fa 16 anys. Expert Apunts: 490 Data d'incorporació: 09/06/08 Publicacions recents
Hi,

I have some questions regarding the search:

The Web Content search seems to only include content that is actually put on some page.
If a Web Content is displayed e.g. only through the Asset publisher the Web Content search does not find those articles (yes, I did re-index everything).

But they are found when using the portal wide search instead (which makes it even more confusing for the user)

The "Search Portlet" (portal-wide) always searches in all portlets, even in disabled ones.
I'm not using Blogs, Wiki, Forum etc.

So: how can I control the portlets that are searched by the portal search? I want to restrict this to Web Content and Document Library

And how can I adjust the display of the search result?
(I guess I already know that answer: I need patch the Liferay source code emoticon ):

Making the results from the blog search the most prominent one is ridicolous. Web Content is a lot more important for an enterprise portal. The "result" for the blogs is even displayed when the portlet is disabled (leaving 3/4 of the page blank and the relevant search results are hidden in a tiny little "Web Content" result area.
thumbnail
1803863, modificat fa 16 anys. Junior Member Apunts: 83 Data d'incorporació: 18/12/08 Publicacions recents
Hi Thomas

You can refer this post.

HTH
Thanks & Regards
Parul Seth
Impetus Infotech (India) Pvt. Ltd.
940514, modificat fa 16 anys. Expert Apunts: 490 Data d'incorporació: 09/06/08 Publicacions recents
Sigh.... patching Liferay source again

Thanks for the answer anyway
thumbnail
1803863, modificat fa 16 anys. Junior Member Apunts: 83 Data d'incorporació: 18/12/08 Publicacions recents
That is inevitable emoticon

But as Victor and I have discussed in that post , it'll be good to have that level of customization in the serach portlet by default. As per your requirement its just commenting out few lines in the liferay-portlet.xml emoticon

Thanks & Regards
Parul Seth
940514, modificat fa 16 anys. Expert Apunts: 490 Data d'incorporació: 09/06/08 Publicacions recents
Just for the record:

My workaround is to change search.jsp and instead of
List portlets = PortletLocalServiceUtil.getPortlets(company.getCompanyId(), false, false);

I'm manually adding the portlets I want to search:
List portlets = new ArrayList(); 
Portlet webContent = PortletLocalServiceUtil.getPortletById(company.getCompanyId(), "15");
portlets.add(webContent);
Portlet docLib = PortletLocalServiceUtil.getPortletById(company.getCompanyId(), "20");
portlets.add(docLib);


Your suggestion to retrieve only the portlets used in the community:
LayoutTypePortlet layoutTypePortlet2 = (LayoutTypePortletImpl)layout.getLayoutType();
List portlets = layoutTypePortlet2.getPortlets();

did not work for me. With that code no search results were shown (seems that the list of portlets is empty in this case)

Parul Seth:
That is inevitable emoticon

Unfortunately I hear that way too often.

Having to customize the portal by patching the source creates a maintenance nightmare when you want to upgrade to a new version.
thumbnail
1803863, modificat fa 16 anys. Junior Member Apunts: 83 Data d'incorporació: 18/12/08 Publicacions recents
Hi Thomas

Yes you can do that or as I said you can comment out the open search classes in liferay-portlet.xml, either ways it'll serve the purpose.

Your suggestion to retrieve only the portlets used in the community:


That works fine for me though.

Yeah that's very true and so we have been blessed by liferay with ext emoticon


Thanks & Regards
Parul Seth
Impetus Infotech (India) Pvt. Ltd.
940514, modificat fa 16 anys. Expert Apunts: 490 Data d'incorporació: 09/06/08 Publicacions recents
But I still don't understand why the web content search produces a different result than the "global search".

I have a search box in my theme using $theme.journalContentSearch() and that does not find articles that are only shown through the asset publisher.

Using the "Search Portlet" those articles are found (and shown as part of the WebContent result), so why are they excluded in the web content search?

blessed by liferay with ext
It's more of a curse than a blessing.
It makes upgrades a nightmare.
I'll go for a JSP hook which is still a nightmare but not as much as the ext environment
thumbnail
478322, modificat fa 16 anys. Regular Member Apunts: 226 Data d'incorporació: 13/02/08 Publicacions recents
I guess this should solve your first problem


##
## Journal Content Search Portlet
##

    #
    # Set whether unlisted articles are excluded from search results.
    #
    journal.content.search.show.listed=true
940514, modificat fa 16 anys. Expert Apunts: 490 Data d'incorporació: 09/06/08 Publicacions recents
Arvind Mishra:
I guess this should solve your first problem

journal.content.search.show.listed=true


Great, thanks.