This documentation provides instructions on how to use the Project Endings staticSearch Generator to provide a fully-functional search ‘engine’ to your website without any dependency on server-side code such as a database.
staticSearch 2.0 contains breaking changes and improvements to staticSearch. In particular, the configuration file has been significantly re-organized; configuration files made for earlier versions of staticSearch will not work in 2.0.
When you update staticSearch, the build will attempt to convert a v1.0 configuration fil to v2.0 and save it as a new file. The following table summarizes changes to the configuration file, but see the updated documentation in 8.5 Creating a configuration file for more details, samples, and a template file.
| Element | Change | Description |
| searchFile | Renamed to <searchPage>; now uses a file attribute | v1 used text content; v2 requires
<searchPage file="index.html"/>
|
| <index>/recurse | Preserved in v2 | Still appears as a recurse attribute on the index element. |
| stopwordsFile | Now uses a <stopwords> element with a file attribute | Default file locations moved from
/xsl/⚓to /stopwords/⚓; warnings emitted if old defaults are detected. |
| dictionaryFile | Now uses a <dictionary> element with a file attribute | Default dictionary files moved from
/xsl/⚓to /dicts/⚓; warnings emitted for old default paths. |
| <scoringAlgorithm> | Value now in a name attribute | v1 used text content; v2 uses
<scoringAlgorithm name="tf-idf"/> Note that there also new values of <scoringAlgorithm>. |
| stemmerFolder | Becomes a <stemmer> element with a dir attribute | The path is prefixed with
stemmers/⚓; now written as <stemmer dir="stemmers/en"/>
|
| minWordLength | Moved into <tokenizer> element as an attribute | Now appears as
<tokenizer minWordLength="3"/>
|
| createContexts and related settings | Reorganized into one <createContexts> element with attributes | v2 enforces rules about valid attributes depending on whether create is true or false; options such as phrasalSearch and wildcardSearch move to attributes. |
| phrasalSearch | Now an attribute of <createContexts> | Only present when create=true. |
| wildcardSearch | Now an attribute of <createContexts> | Only present when create=true. |
| maxKwicsToHarvest | Now an attribute of <createContexts> | Written only when phrasalSearch=false. |
| totalKwicLength | Renamed to maxKwicLength | Now an attribute of createContexts. |
| kwicTruncateString | Now an attribute of <createContexts> | Required when create=true. |
| resultsPerPage | Moved into <results> element as an attribute | Now appears as
<results resultsPerPage="3"/>
|
| maxKwicsToShow | Moved into <results> element as an attribute | Now appears as
<results maxKwicsToShow="3"/>
|
| resultsLimit | Renamed to maxResults | Now appears as
<results maxResults="3"/>
|
| versionFile | Now a version element with a file attribute | Changed from text content to
<version file="VERSION"/>
|
| outputFolder | Now an output element with a dir attribute | Changed from text content to
<output dir="search"/>
|
| verbose | Removed | The verbose option has been removed and replaced by the ssVerbose property in ant. To get debugging messages, set the ssVerbose parameter to true (other
accepted values: t, yes, y, 1)
ant -DssConfig=cfg.xml -DssVerbose=true ⚓ |
| indentJSON | Removed | <indentJSON> has been removed since it is rarely necessary other than for debugging purposes, which can be better handled by other tools (i.e. viewed in Firefox or using the command-line tool jq). |
| linkToFragmentId | Removed | <linkToFragmentId>, which controlled whether the search results should link back to the nearest document
fragment with an id, has been made part of the default behaviour of staticSearch and is no longer configurable.
However, if you do not want the link to the nearest fragment to appear in the results,
you can visually hide the link element with the fidLink class in your site's CSS:
.fidLink{ display:none; } ⚓
|
| scrollToTextFragment | Removed | The <scrollToTextFragment> option, which relied on the experimental Text Fragments specification, has been removed. A more reliable alternative is to use JavaScript to highlight hits on the target page. |