Skip to content

Ratings and Comments for Search Results

mhogeweg edited this page Dec 26, 2012 · 2 revisions

Enabling the ability for users to leave ratings and comments on search results can help users determine what resources may be best suited for their needs.

This topic discusses how to enable ratings and comments, and the options for this feature. Once configured, see How to Leave a Resource Review for how to use the ratings and comments.

To enable comments and ratings, follow these steps.

  • Open \\geoportal\WEB-INF\classes\gpt\config\gpt.xml.
  • Find the section shown below:
<parameter key="assertion.index.enabled" value="true"/>
<parameter key="assertion.index.location" value=""/>
<parameter key="assertion.index.allowNonLocalResourceIds" value="false"/>
<parameter key="assertion.rating.enabled" value="true"/>
<parameter key="assertion.comment.enabled" value="true"/>
<parameter key="assertion.comment.maxLength" value="2048"/>
  • This section defines if ratings and comments are enabled. Update each parameter as desired, using the guidance below.
    • assertion.index.enabled: Set the value="true" if you want to enable comments and ratings.
    • assertion.index.location: Identify the filepath to the folder that will hold the indexed comments and ratings. For example, value="C:\geoportal\assertion_index_location". You will need to create a new folder for this - it should not be the same location as your lucene index folder. Also, it may be desirable to create a backup & restore plan for this folder so you can recover the comments and ratings if the content is ever deleted.
    • assertion.index.allowNonLocalResourceIds: Set the value="true" if you want to enable comments and ratings about resources that do not exist in your local catalog (e.g., nonlocal resources can be discovered through federated search).
    • assertion.rating.enabled: Set the value="true" to allow users to rate resources. By default, the rating system is thumbs up or thumbs down.
    • assertion.comment.enabled: Set the value="true" to allow users to leave comments for resources.
    • assertion.comment.maxLength: This sets the maximum characters allowed for one comment. Default is value="2048".
  • Now, scroll down in the gpt.xml file to the <search>section. In that section, find the searchResultsReviewsShown attribute. This attribute determines when the thumbs up/thumbs down icon will be displayed on the search result. Set searchResultsReviewsShown as desired, using one of the following options:
    • none: reviews will not be shown on any search result, even if the search result item has been reviewed.
    • only-reviewed: reviews will be shown only on search results that have been reviewed. The dominant review count will be shown - e.g., if there have been five reviews with three being positive and two negative, then the review will show +2.
    • all: reviews will be shown on all search results, even if the search result item has not been reviewed. For items that have not been reviewed, the review will show the number zero.
  • After setting these parameters, save the gpt.xml file.
  • Restart the geoportal web application for your configuration changes to take affect.
  • See How to Leave a Resource Review to learn how to use these features.

Back to Customizations
Clone this wiki locally