Static Search provides an alternative search option to statically published silverstripe sites
An implementation of Tipue search designed to work in SilverStripe with the Static Publish Queue module. This implementation uses the static mode of Tipue search.
This module works with:
JSON Format:
{
"title": "page title",
"text":"Prepped page content",
"tags":"Taxonomy or meta description",
"loc":"Page URL"
}
Add this to your composer.json file:
"adrexia/staticsearch": "dev-master"
Update your repo:
composer update
Add the search form to your page:
<% include StaticSearchForm %>
Include StaticSearchRequirements in the head of your page.
<% include StaticSearchRequirements %>
If you like, copy StaticSearchRequirements.ss to your theme, and override with any customized files. These files are only needed for the search page itself. Read the Tipue docs if you experience any issues with the search itself. It can be a bit particular about its set up.
http://www.tipue.com/search/docs/
If you want to make the searchpage fit your site design, copy SearchPage.ss to your theme folder. There is base css provided in staticsearch/css/tipuesearch.css. You can use this as is, or replace with your own css.
Methods generating the data for the json files live in staticsearch/code/extensions/StaticSearchSiteTreeExtension.php. You can override these methods at Page level (e.g. in Page.php). You may wish to have a smaller range of data appear, or you might want to index data objects as content on a page.
These methods can be overridden at Page level. It is suggested that if you are working with larger statically published sites, you use the tagging system (see getSearchableTags()) as the main search mechanism, and limit the content block to a simple abstract.
Run the BuildStaticSearchIndexTask to generate the search_index.json files (note, the static publish queue tasks must have been run at least once to generate the cache itself).
dev/tasks/BuildStaticSearchIndexTask
You probably want to set this task up to run once a day on your live site to update the search index.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem