Quick Search Portlet

Speed up your users. Speed up your portal. Try the Quick-Search for Liferay.


Quick start

For a quick start just drop the portlet on a portal page. Press ctrl + ENTER to display the search field.

Alternatively you can configure the portlet to include the textfield in the portlet body.

Serving the Quick Search for all portal pages

If you want to make the portlet available on every site of you portal, a good approach is to integrate it into your theme. This is done by pasting following Velocity snippet into your portal_normal.vm template. Then you also can hide the portlet via CSS. Then your users can call the portlet by pressing ctrl + ENTER.

#set ($VOID = $velocityPortletPreferences.setValue('display-style', '1'))
#set ($VOID = $velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false'))
#set ($VOID = $velocityPortletPreferences.setValue('maximumSearchResults', '5'))
#set ($VOID = $velocityPortletPreferences.setValue('minSearchLetters', '3'))
#set ($VOID = $velocityPortletPreferences.setValue('assetTypes', 'com.liferay.portal.model.User,com.liferay.portlet.journal.model.JournalArticle,
#set ($myPortletId = "quicksearch_WAR_quicksearchportlet")
$theme.runtime($myPortletId, '', $velocityPortletPreferences.toString())
#set ($VOID = $velocityPortletPreferences.reset())

In this code you are also setting the preferences:

  • maximumSearchResults: Max. amount of results displayed
  • minSearchLetters: Amount of letters to trigger search
  • assetTypes: Asset types enabled for search

Search by Type

To search more precisely, the quick-search portlet enables you to search by asset type, you just have to prefix the type name in your query.

You have to consider that you are restricted to the types which are configured in the portlet configuration.

  • You can use following prefixes to search by type:
  • - user
  • - file
  • - article
  • - site
  • - page
  • - blog
  • - message-board-messages
  • - wiki-page

Navigate with the Quick Search

Another feature of Quick Search is that you can navigate through sites and pages. Using the prefix "site:" or "page:" Quick Search provides you the matching sites or pages for which are you permitted to view. If you select an result and press enter you will be redirected on the page, or on the public page of the site you selected.