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.
<config> (The root element for the Search Generator configuration file.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
—
|
May contain | |
Content model |
<content> <elementRef key="params"/> <elementRef key="rules" minOccurs="0"/> <elementRef key="contexts" minOccurs="0"/> <elementRef key="excludes" minOccurs="0"/> </content> |
Schema Declaration |
element config { params, rules?, contexts?, excludes? } |
<context> (A context definition, providing a match attribute that identifies the context, allowing keyword-in-context fragments to be bounded by a specific context.) | |||||||
Namespace | http://hcmc.uvic.ca/ns/staticSearch | ||||||
Module | ss — Schema specification and tag documentation | ||||||
Attributes | att.match (@match) att.labelled (@label)
|
||||||
Contained by |
ss: contexts
|
||||||
May contain | Empty element | ||||||
Content model |
<content> <empty/> </content> |
||||||
Schema Declaration |
element context { att.match.attributes, att.labelled.attributes, attribute context { text }?, empty } |
<contexts> (The set of contexts, expressed as XPath in match, that controls the identification of contexts for keyword-in-context fragments.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: config
|
May contain |
ss: context
|
Content model |
<content> <elementRef key="context" minOccurs="1" maxOccurs="unbounded"/> </content> |
Schema Declaration |
element contexts { context+ } |
<createContexts> (Whether to include keyword-in-context extracts in the index. This increases the size of the index considerably, but it allows for more user-friendly search results, as well as phrasal searches.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD boolean
|
Content model |
<content> <dataRef name="boolean"/> </content> |
Schema Declaration |
element createContexts { xsd:boolean } |
<dictionaryFile> (The location of a dictionary file (one word per line) which will be used to check tokens when indexing.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD anyURI
|
Content model |
<content> <dataRef name="anyURI"/> </content> |
Schema Declaration |
element dictionaryFile { xsd:anyURI } |
<exclude> (An exclusion definition, which excludes either documents or filters as defined by an XPath in match.) | |||||||
Namespace | http://hcmc.uvic.ca/ns/staticSearch | ||||||
Module | ss — Schema specification and tag documentation | ||||||
Attributes | att.match (@match)
|
||||||
Contained by |
ss: excludes
|
||||||
May contain | Empty element | ||||||
Content model |
<content> <empty/> </content> |
||||||
Schema Declaration |
element exclude { att.match.attributes, attribute type { "index" | "filter" }, empty } |
<excludes> (The set of exclusions, expressed as XPath in match, that control the subset of documents for a particular search.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: config
|
May contain |
ss: exclude
|
Content model |
<content> <elementRef key="exclude" minOccurs="1" maxOccurs="unbounded"/> </content> |
Schema Declaration |
element excludes { exclude+ } |
<indentJSON> (Whether or not to indent code in the JSON index files. Indenting increases the file size, but it can be useful if you need to read the files for debugging purposes.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD boolean
|
Content model |
<content> <dataRef name="boolean"/> </content> |
Schema Declaration |
element indentJSON { xsd:boolean } |
<kwicTruncateString> (The string that will be used to signal ellipsis at the beginning and end of a keyword-in-context extract. Conventionally three periods, or an ellipsis character.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain | Character data only |
Content model |
<content> <textNode/> </content> |
Schema Declaration |
element kwicTruncateString { text } |
<linkToFragmentId> (Whether to link keyword-in-context extracts to the nearest id in the document. Default is true.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD boolean
|
Content model |
<content> <dataRef name="boolean"/> </content> |
Schema Declaration |
element linkToFragmentId { xsd:boolean } |
<maxKwicsToHarvest> (This controls the maximum number of keyword-in-context extracts that will be stored for each term. If phrasalSearch is set to true, this parameter is ignored, because phrasal searches will only work properly if all contexts are stored.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD nonNegativeInteger
|
Content model |
<content> <dataRef name="nonNegativeInteger"/> </content> |
Schema Declaration |
element maxKwicsToHarvest { xsd:nonNegativeInteger } |
<maxKwicsToShow> (This controls the maximum number of keyword-in-context extracts that will be shown in the search page for each hit document returned.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD nonNegativeInteger
|
Content model |
<content> <dataRef name="nonNegativeInteger"/> </content> |
Schema Declaration |
element maxKwicsToShow { xsd:nonNegativeInteger } |
<outputFolder> (The name of the output folder into which the index data and JavaScript will be placed in the site search. This should conform with the XML Name specification.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD NCName
|
Content model |
<content> <dataRef name="NCName"/> </content> |
Schema Declaration |
element outputFolder { xsd:NCName } |
<params> (Element containing most of the settings which enable the Generator to find the target website content and process it appropriately.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: config
|
May contain | |
Content model |
<content> <elementRef key="searchFile"/> <elementRef key="versionFile" minOccurs="0"/> <elementRef key="stemmerFolder" minOccurs="0"/> <elementRef key="recurse"/> <elementRef key="linkToFragmentId" minOccurs="0"/> <elementRef key="scrollToTextFragment" minOccurs="0"/> <elementRef key="scoringAlgorithm" minOccurs="0"/> <elementRef key="phrasalSearch" minOccurs="0"/> <elementRef key="wildcardSearch" minOccurs="0"/> <elementRef key="createContexts" minOccurs="0"/> <elementRef key="maxKwicsToHarvest" minOccurs="0"/> <elementRef key="maxKwicsToShow" minOccurs="0"/> <elementRef key="totalKwicLength" minOccurs="0"/> <elementRef key="kwicTruncateString" minOccurs="0"/> <elementRef key="verbose" minOccurs="0"/> <elementRef key="stopwordsFile" minOccurs="0"/> <elementRef key="dictionaryFile" minOccurs="0"/> <elementRef key="replacementsFile" minOccurs="0"/> <elementRef key="indentJSON" minOccurs="0"/> <elementRef key="outputFolder" minOccurs="0"/> </content> |
Schema Declaration |
element params { } |
<phrasalSearch> (Whether or not to support phrasal searches. If this is true, then the maxContexts setting will be ignored, because all contexts are required to properly support phrasal search.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD boolean
|
Content model |
<content> <dataRef name="boolean"/> </content> |
Schema Declaration |
element phrasalSearch { xsd:boolean } |
<recurse> (Whether to recurse into subdirectories of the collection directory or not.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD boolean
|
Content model |
<content> <dataRef name="boolean"/> </content> |
Schema Declaration |
element recurse { xsd:boolean } |
<rule> (A rule that specifies a document path as XPath in match, and provides weighting for search terms found in that context.) | |||||||
Namespace | http://hcmc.uvic.ca/ns/staticSearch | ||||||
Module | ss — Schema specification and tag documentation | ||||||
Attributes | att.match (@match)
|
||||||
Contained by |
ss: rules
|
||||||
May contain | Empty element | ||||||
Content model |
<content> <empty/> </content> |
||||||
Schema Declaration |
element rule { att.match.attributes, attribute weight { text }, empty } |
<rules> (The set of rules, expressed as XPath in match, that control weighting of search terms found in specific contexts.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: config
|
May contain |
ss: rule
|
Content model |
<content> <elementRef key="rule" minOccurs="1" maxOccurs="unbounded"/> </content> |
Schema Declaration |
element rules { rule+ } |
<scoringAlgorithm> (Which scoring algorithm to use. Default is "raw" (i.e. weighted counts)) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain | Empty element |
Content model |
<content> <valList type="closed"> <valItem ident="raw"> <desc>raw score</desc> <gloss>Default: Calculate the score based off of the weighted number of instances of a term in a text.</gloss> </valItem> <valItem ident="tf-idf"> <gloss>Calculate the score based off of the tf-idf scoring algorithm.</gloss> </valItem> </valList> </content>Legal values are:
|
Schema Declaration |
element scoringAlgorithm { "raw" | "tf-idf" }Legal values are:
|
<scrollToTextFragment> (WARNING: Experimental technology. This turns on a feature currently only supported by a subset of browsers, enabling links from keyword-in-context results directly to the specific text string in the target document.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD boolean
|
Content model |
<content> <dataRef name="boolean"/> </content> |
Schema Declaration |
element scrollToTextFragment { xsd:boolean } |
<searchFile> (The search file (aka page) that will be the primary access point for the staticSearch. Note that this page must be at the root of the collection directory.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD anyURI
|
Content model |
<content> <dataRef name="anyURI"/> </content> |
Schema Declaration |
element searchFile { xsd:anyURI } |
<stemmerFolder> (The name of a folder inside the staticSearch /stemmers/ folder, in which the JavaScript and XSLT implementations of stemmers can be found. If left blank, then the staticSearch default English stemmer will be used (stemmers/en).) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD NCName
|
Content model |
<content> <dataRef name="NCName"/> </content> |
Schema Declaration |
element stemmerFolder { xsd:NCName } |
<stopwordsFile> (The location of a text file containing a list of stopwords (words to be ignored when indexing). These are typically words too common to be worth searching for, but every site will also have some specific terms which are used so widely across the site that they should be suppressed to control the index size. The list should be in plain text with one word per line.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD anyURI
|
Content model |
<content> <dataRef name="anyURI"/> </content> |
Schema Declaration |
element stopwordsFile { xsd:anyURI } |
<totalKwicLength> (If createContexts is set to true, then this parameter controls how long the contexts will be.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD nonNegativeInteger
|
Content model |
<content> <dataRef name="nonNegativeInteger"/> </content> |
Schema Declaration |
element totalKwicLength { xsd:nonNegativeInteger } |
<verbose> (Turns on more detailed reporting during the indexing process.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD boolean
|
Content model |
<content> <dataRef name="boolean"/> </content> |
Schema Declaration |
element verbose { xsd:boolean } |
<versionFile> (The relative path to a text file containing a single version identifier (such as 1.5, 123456, or 06ad419). This will be used to create unique filenames for JSON resources, so that when a site is updated, so that the browser will not use cached versions of older index files.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD anyURI
|
Content model |
<content> <dataRef name="anyURI"/> </content> |
Schema Declaration |
element versionFile { xsd:anyURI } |
<wildcardSearch> (Whether or not to support wildcard searches. Note that wildcard searches are more effective when phrasal searching is also turned on, because the contexts available for phrasal searches are also used to provide wildcard results.) | |
Namespace | http://hcmc.uvic.ca/ns/staticSearch |
Module | ss — Schema specification and tag documentation |
Contained by |
ss: params
|
May contain |
XSD boolean
|
Content model |
<content> <dataRef name="boolean"/> </content> |
Schema Declaration |
element wildcardSearch { xsd:boolean } |
att.labelled (A class providing a label attribute that can be used to identify/describe contexts and other things which benefit from description.) | |||||||
Module | ss — Schema specification and tag documentation | ||||||
Members | context | ||||||
Attributes |
|
att.match (A class providing attributes that enable specification of document locations.) | |||||||
Module | ss — Schema specification and tag documentation | ||||||
Members | context exclude rule | ||||||
Attributes |
|