Configuring Search

uPortal Search has the ability to search through portlet definitions, user information, portlet content, calendar, external web sites, Google Search Appliances, and other portlets that choose to participate in the search process to return useful information to the user.  The various components of the search are configurable, and pluggable.  Searches are performed via the search Launcher portlet (top-right of the authenticated user screen by default) and the Search portlet.

uPortal 4.0.14+: uPortal supports configurable autocomplete on searching (requires applying commit).

Configuring uPortal Search

Search is configured via several beans in the /uportal-war/src/main/resources/properties/contexts/servicesContext.xml file. 

Search Services

By default, the titles and descriptions of portlets in the portlet registry are included in the search.  You can uncomment the Google Search service (searches the web) or Google Search Appliance service (searches your University sites) to include those results in the search.

searchServices
    <util:list id="searchServices">
        <bean class="org.jasig.portal.portlets.search.portletregistry.PortletRegistrySearchService"/>
        
        <!-- Uncomment and fill in your Google Custom Search ID to use
        <bean class="org.jasig.portal.portlets.search.google.GoogleCustomSearchService">
            <property name="customSearchId" value="" />
        </bean>
         -->
         
        <!-- Uncomment and fill in your Google Search Appliance URL and Site to use
        <bean class="org.jasig.portal.portlets.search.gsa.GsaSearchService">
            <property name="baseUrl" value="http://search.example.com"/>
            <property name="site" value="Site"/>
        </bean>
        -->
    </util:list>

In addition, some Framework Portlets (portlets part of uPortal itself) have search integrated.

Framework PortletSearch Result Type valueConfiguration Notes
Directory PortletDirectoryConfiguring Directory Search, in particular the list directoryQueryAttributes

Displaying Search Results on different tabs

By default, all search results appear on the default search results tab.  You can display results from various search sources on different tabs by placing the search result type name in a map that has a message.properties code to identify the tab name to display.

search tabs
    <!-- 
     | Maps search resultType strings to tabs that are displayed in the results. If a resultType is not
     | mapped below its results go in the default tab.
     |
     | The key is the Messages.properties key to use for the result tab name 
     +-->
     <util:map id="searchTabs">
        <entry key="googleInstitution.results">
            <list>
                <value>googleCustom</value>
                <value>googleAppliance</value>
            </list>
        </entry>
    </util:map>

Configuring Search Autocomplete (uPortal 4.0.14+)

With uPortal 4.0.14, searches can support a configurable autocomplete feature that performs searches as you type and displays the results in an autocomplete list.  By default this feature is not present in the uPortal 4.0.x code base because it changes some layouts and portlet definitions, but can be applied fairly easily.  See  UP-3887 - Getting issue details... STATUS .

Configuration of this feature is in the same servicesContext.xml file.  You can configure the priority of results to display based on the result source.

Autocomplete prioritization
    <!--
     | For search autocomplete, indicate a set of priorities for each type of search result type.  Lower values
     | result in the search result appearing higher in the list (e.g. greater emphasis).
     |
     | Key: value set by the various Search services in the SearchResult.type field.
     |
     | Value: The value is the general priority for results of that type.  The default priority if not specified
     | is priority 0.  A positive value is lower than the default priority (i.e. de-emphasizes result),
     | and a negative value is higher than the default priority (e.g. emphasizes result).
     +-->
    <util:map id="searchAutocompletePriorityMap" value-type="java.lang.Integer">
        <entry key="Portlet List" value="-5"/>
        <entry key="Calendar" value="-2"/>
        <entry key="Directory" value="5"/>
        <!--<entry key="googleAppliance" value="0"/>-->
        <!--<entry key="googleCustom" value="0"/>-->
    </util:map>

In addition, if there are search result sources you do not want at all in the autocomplete search results, you can filter them out.

Removing results from autocomplete
    <!--
     | Set of the search result types to exclude from search autocompletion.  The value is the set by the
     | various Search services in the SearchResult.type field.
     +-->
    <util:set id="searchAutocompleteIgnoreResultTypes">
        <!--<value>Directory</value>-->
    </util:set>

 

Integrating portlets into uPortal Search

Portlets may search their contents and return results relevant to the search by incorporating SearchEvents into their design.  See the page Search API.

The portlets that participate in uPortal Search by default are present in search results and autocomplete searching.  To configure the tabs or autocomplete preferences for the portlet search results, you need to know the name the portlet assigns the search result type.  If it is not documented on the API page, you can search the portlet source code for "SearchResult" and look for something similar to the following code to find the string to use in the configuration above.

Setting type of search result
            searchResult.getType().add("Directory");

Add Feedback content box here.....