This module allows BrowserCMS to integrate with a Google Search Appliance (Mini or GSA). Google Search Appliance is a standalone search server, which can be configured to crawl your website. This module submits queries to a GSA/Mini server, and formats the results. It consists of the following two portlets.
- Search Box - Displays an input box that submits a search query.
- Google Mini Search Results Portlet - Sends query to the Mini, formats the XML response and displays the results.
- Allows for formatted results of GSA search results.
- Will display Key Matches
- Will display Synonyms/Related Queries
- Allows conditional overriding of collections (i.e. by default it will search one default collection, but a 'site=OTHER_COLLECTION' param can be passed to override that)
- Sort by Date/Relevance - Users can now toggle the results display between date and relevance.
- Cached Links - Each result now correctly generate a link to the cached version of the document as stored by the GSA.
- [GSA Only] Narrow Your Search - Shows users a set of other suggested queries to allow them to 'Narrow Your Search', based on the current query and what results are stored in GSA. Only available for GSA instances, as Google Mini does not support Dynamic Result Clustering.
Note: This module assume the BrowserCMS web site owner has access to their own GSA/Google Mini server, either hosted by themselves or a third party service.
Installing this module is done much like other BrowserCMS modules:
$ rails g cms:install bcms_google_mini_search
After that, you will need to to:
- Configure your Google Mini to crawl your site.
- Configure the module to point to your Google Mini server.
These instructions assume the Mini or Google Search Appliance is already set up and running.
Configuring the mini include three basic steps, configuring it to crawl your site, creating a collection which limits what is returned to just your site, and creating a front end, which allows you to submit search queries.
- Log into your search appliance (i.e. http://google.mini.mysite.com), and enter your account username/password.
- Click on the 'Crawl and Index' link in the left navigation.
- In the top box 'Start Crawling from the Following URLs:' add a new line with the full domain name of your site. (i.e. http://www.mysite.com)
- In the bottom box, 'Follow and Crawl Only URLs with the Following Patterns:', enter a pattern of urls you want to crawl. (i.e. www.mysite.com/)
- Click 'Save URLs to Crawl button'
Once the crawler is configured, it may take 15+ minutes for it to crawl your site. You can still finish configuring the mini, but you may need to wait to test the results.
- Click the collections link in the left nav. This will allow use a create a search collection specifically for this site.
- Type the name of the new collection into the 'Collection Name' text box, and click 'Create Collection' (i.e. MYSITE).
- After the page refreshes, click the 'Edit' link to the right of the new collection.
- In the top box, 'Include Content Matching the Following Patterns:', enter the same pattern as step B.1.3 above (i.e. http://www.mysite.com/)
- Click 'Save Collection Defination'
- In the left nav, click the 'Serving' link
- In the 'Front End Name' text field, enter the name for your front end. (i.e. MYSITE_frontend.)
- Click 'Create Front End' to save it.
At this point, you should have the Google Mini appliance configured. If you want to test out the search results using the Mini's default search UI, you can click the 'Test Center' link in the upper right hand corner. Select your new collection and front end by name, and submit queries.
To make the module work, you will have to configure two portlets.
- In your sitemap, create a new section called 'Search', with a path '/search'.
- Create a page called 'Search Results', with a path '/search/search-results'.
- On that page, add a new 'Google Mini Search Engine' portlet. Keep the default for most fields.
- In the Service URL, field, enter in the domain name to your google mini server (i.e. http://google.mini.mysite.com). Note: This URL should be just the domain, i.e. no /search.
- In the Collection Name field, enter the same name you gave your collection in B.2.2. (i.e. MYSITE)
- In the Front End Name field, enter the same name you have your frontend in B.3.2 (i.e. MYSITE_frontend)
- Make sure the 'path' attribute is the same as the page you are adding the portlet to (i.e. /search/search-results
- Save the portlet
- On another page create a Search Box portlet (alternatively, you can create the portlet and add it your templates via render_portlet)
- Set the 'Search Engine Name' field to the exact same name as the portlet in step C.3 above (i.e. Google Mini Search Engine)
- Save the portlet
At this point, you can test the search by entering in a term to the Search Box portlet. If its working, it should call the Search Results page and display the same results as what you see in the Mini 'Test Center'. You can style the HTML in the template to tweak how your search results will work.