Enterprise Search module

This chapter describes:

1 Introduction

This module is based on the Gentics Content Connector which connects Apache Lucene with the Gentics Content Repository (CR) and the Gentics Content API. It allows to show search forms, perform content search and output search results.

The search widget can be added to all content pages (except binary files).

2 Structure

The search module is placed in folder <portal>/common/modules/search. It depends on personalisation module.

Structure is the same as for other modules.

3 Search widgets

There are 3 widgets:

  • SimpleSearchWidget – outputs a simple search form.
  • AdvancedSearchWidget – outputs an advanced search form. Additional options depending on the module configuration
  • SearchResultWidget – performs search and outputs the result (including paging).

3.1 SimpleSearchWidget

Invokes:


<?php $this->widget('search.widgets.SimpleSearchWidget'); ?>

Parameters:

  • useAutosuggest (bool) – by default it is true. If it is true, then the portal will try to perform autosuggestion for entered search term. You know that feature from google search.
  • landingPage (string) – defines the page where the search form will be submitted to and results will be displayed

3.2 AdvancedSearchWidget

Invokes:


<?php $this->widget('search.widgets.AdvancedSearchWidget', array(
    'useAutosuggest'=>true, 'landingPage'=>'Content.Node/search_result.html')
); ?>

Parameters:

  • useAutosuggest (bool) – by default it is true. If it is true, then the portal will try to perform autosuggestion for entered search term. You know that feature from google search.
  • landingPage (string) – defines the page where the search form will be submitted to and results will be displayed

3.3 SearchResultWidget

Invokes:


<?php $this->widget('search.widgets.SearchResultWidget'); ?>

usePersonalisation (bool) – default is true. Defines if the results should be personalized or not. At the moment, if usePersonalisation is set to false – user will see all matching results. Then if the user clicks on an entry, which is not allowed for him, the user will see the login page and after logging in sucessfully a redirect to the requested page will be done.

4 Configuration

  • Default configuration is commented inline:

    'search' => array(
        // class
        'class' => 'common.modules.search.SearchModule',
        //  cache life time in seconds
        'cacheTime' => 360,
        // CMS page that contains SearchResultWidget.
        // You can overwrite this setting from widget call in landingPage parameter
        'defaultLandingPage' => '/Content.Node/service/search/search.en.html',
        // CMS landing pages for every language (pages with SearchResultWidget in different languages)
        // You can overwrite this setting from widget call in landingPage parameter
        'landingPages' => array('en'=>'/Content.Node/service/search/search.en.html'),
        // personalisation delimiter. Used to split personalisation string after search request
        'personalisationDelimiter' => ' ',
        //perPage defines how many found results should be displayed per page
        'perPage' => 5,

        'mimetype' => array(
           //show or not this field on advanced form
           'showOnAdvancedSearchForm' => true,
           //list of allowed mimetypes
           'options' => array(
               'html',
               'php',
               'pdf',
               'doc',
           ),
           //default value
           'default' => 'html'
        ),
        'whereToSearch' => array(
           //show dropdown list on advanced search form to select where to search
           'showOnAdvancedSearchForm' => true,
           //list of fields from Gentics Content Repository which are search
           //(must be configured in Apache Lucene)
           'options' => array(
               'content',
               'name',
           ),
           //default value
           'default' => 'content'
        ),
        'searchType' => array(
           'showOnAdvancedSearchForm' => true,
           //list of options
           'options' => array(
               //  OR means any of given words must be present in result
               'OR',
               //  EXACT means the searcher would search for exact phrase
               'EXACT',
               //  AND means all words must be present in result
               'AND',
               //  NOT will exclude all words except for the first one
               'NOT'
           ),
           //default value
           'default' => 'OR'
        ),

        'urlLimiter' => array(
           //show dropdown list on advanced search form to select where to search
           'showOnAdvancedSearchForm' => true,
           //list of options
           'options' => array(
               'all' => 'No filter',
               '/company/' => 'Company',
               '/blog/' => 'Blog',
           ),
           //default value
           'default' => 'all'
       ),
       //this string will always be added to the end of all search requests
       // should start with AND
       'staticString' => '',
    ),