diff --git a/buildRelease.xml b/buildRelease.xml index 5695662c..727a76fe 100644 --- a/buildRelease.xml +++ b/buildRelease.xml @@ -51,6 +51,7 @@ + @@ -61,6 +62,7 @@ + diff --git a/docs/staticSearch.html b/docs/staticSearch.html index e6469ead..46fab051 100644 --- a/docs/staticSearch.html +++ b/docs/staticSearch.html @@ -89,7 +89,7 @@
Martin Holmes
Joey Takeda
-
2019-2025
+
2019–2026

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 @@ -392,8 +392,8 @@

8.1 Configuring your s

8.1.1 Description filters

The description (desc) filter is a word or phrase describing or associated with the document. Here is a simple example: -
<meta name="Document type"
class="staticSearch_desc" content="Poems"/>
This specifies that there is to be a descriptive search filter called ‘Document type’, and one of the types is ‘Poems’; the document containing this <meta> tag is one of the Poems. Another type might be: -
<meta name="Document type"
class="staticSearch_desc" content="Short stories"/>
If the Generator finds such meta tags when it is indexing, it will create a set of +
<meta name="Document type"
class="staticSearch_desc" content="Poems"/>
This specifies that there is to be a descriptive search filter called ‘Document type’, and one of the types is ‘Poems’; the document containing this <meta> tag is one of the Poems. Another type might be: +
<meta name="Document type"
class="staticSearch_desc" content="Short stories"/>
If the Generator finds such meta tags when it is indexing, it will create a set of filter controls on the search page, enabling the user to constrain the search to a specific set of filter settings.
@@ -404,7 +404,7 @@

8.1.1.1 Sort order for the strict alphabetical order of items may not be exactly what you want; you may want to sort ‘305 2’ before ‘305 10’ for example. To deal with cases like this, in addition to the content attribute, you can also supply a custom data-ssfiltersortkey attribute, providing a sort key for each label. Here is are a couple of examples: -
<meta name="Archival series"
class="staticSearch_desc" data-ssfiltersortkey="305_02"
content="305 2"/>

<meta name="Archival series"
class="staticSearch_desc" data-ssfiltersortkey="305_10"
content="305 10"/>
In this case, the first item will sort in the filter list before the second item +
<meta name="Archival series"
class="staticSearch_desc" data-ssfiltersortkey="305_02"
content="305 2"/>

<meta name="Archival series"
class="staticSearch_desc" data-ssfiltersortkey="305_10"
content="305 10"/>
In this case, the first item will sort in the filter list before the second item based on the sort key; without it, they would sort in reverse order based on the content attribute. Note that the data-ssfiltersortkey attribute name is all-lower-case, to comply with the XHTML5 schema.

@@ -412,7 +412,7 @@

8.1.1.1 Sort order for

8.1.2 Date filters

Another slightly different kind of search control is a document date. If your collection of documents has items from different dates, you can add a <meta> tag like this: -
<meta name="Date of publication"
class="staticSearch_date" content="1895-01-05"/>
The date may take any of the following forms: +
<meta name="Date of publication"
class="staticSearch_date" content="1895-01-05"/>
The date may take any of the following forms:
  • 1895 (year only)
  • 1895-01 (year and month)
  • @@ -431,21 +431,21 @@

    8.1.3 Number filtersYou can also configure a range filter based on a numeric value (integer or decimal). For example, you might want to allow people to filter documents in the search results based on their word-count: -
    <meta name="Word-count"
    class="staticSearch_num" content="2193"/>
    Users would then be able to set a minimum and/or maximum word-count when searching +
    <meta name="Word-count"
    class="staticSearch_num" content="2193"/>
    Users would then be able to set a minimum and/or maximum word-count when searching for documents.

8.1.4 Boolean filters

A fourth filter type is the boolean (true/false) filter. To use boolean filters, add meta tags like this to your documents: -
<meta name="Peer-reviewed"
class="staticSearch_bool" content="true"/>
+
<meta name="Peer-reviewed"
class="staticSearch_bool" content="true"/>

8.1.5 Feature filters

The feature (feat) filter, just like a description filter, is a word or phrase describing or associated with the document. Here is a simple example: -
<meta name="People mentioned"
class="staticSearch_feat" content="Nelson Mandela"/>
This specifies that there is to be a feature search filter called ‘People mentioned’, and one of the possible people is ‘Nelson Mandela’. This differs from a description filter in that the number of possible people (or +
<meta name="People mentioned"
class="staticSearch_feat" content="Nelson Mandela"/>
This specifies that there is to be a feature search filter called ‘People mentioned’, and one of the possible people is ‘Nelson Mandela’. This differs from a description filter in that the number of possible people (or other feature) is expected to be large. If there are (for example) three hundred people mentioned in the document collection, then using a description filter would result in three hundred checkboxes in the search page; this is clearly impractical. Instead, @@ -453,7 +453,7 @@

8.1.5 Feature filters< the user can type some part of the feature they're searching for, and get a drop-down list of matches. Selecting a match creates a checkbox in the search page, which then functions just like a description filter. Here's another example: -
<meta name="Postcodes mentioned"
class="staticSearch_feat" content="V8W 1P4"/>
Obviously, a feature filter must be based on data that a searcher will be able to +
<meta name="Postcodes mentioned"
class="staticSearch_feat" content="V8W 1P4"/>
Obviously, a feature filter must be based on data that a searcher will be able to predict. Searchers can also search for names or postcodes using the text search facility, of course, but names might appear in different forms in different texts, so a feature filter allows the user to find all instances of a particular person using the canonical @@ -474,7 +474,7 @@

8.2 Configuring your s part of their document title, but it would be pointless to include this in the search result links. Therefore you can override the document title value by providing another meta tag, like this: -
<meta name="docTitle"
class="staticSearch_docTitle" content="What I did in my holidays"/>
+
<meta name="docTitle"
class="staticSearch_docTitle" content="What I did in my holidays"/>

@@ -489,7 +489,7 @@

8.3 Configuring your s which documents without hit scores, or sequences of documents with the same hit score, are presented. You can do this by adding a single meta tag to the document providing a ‘sort key’, which can be used to sort the list of hits. This is an example: -
<meta name="docSortKey"
class="staticSearch_docSortKey" content="d_1854-01-02"/>
+
<meta name="docSortKey"
class="staticSearch_docSortKey" content="d_1854-01-02"/>

@@ -499,7 +499,7 @@

8.4 Configuring your s document itself is actually an image (perhaps your site is a set of pages dealing with works of art, for instance). Whatever the reason, you can supply a link to a thumbnail image like this: -
<meta name="docImage"
class="staticSearch_docImage" content="images/thisPage.jpg"/>
The content attribute value should either be the path to an image relative to the document itself +
<meta name="docImage"
class="staticSearch_docImage" content="images/thisPage.jpg"/>
The content attribute value should either be the path to an image relative to the document itself or the URL to an external image; so in the example above, there would be a folder called images which is a sibling of the HTML file containing the tag, and that folder would contain a file called thisPage.jpg.

@@ -579,7 +579,7 @@

8.5.1 Quickstart: Exam

8.5.2 The <config> element

The configuration element has a root <config> element in the staticSearch namespace (http://hcmc.uvic.ca/ns/staticSearch): -
<config xmlns="http://hcmc.uvic.ca/ns/staticSearch">
<params>
<!--Parameters-->
</params>
<rules>
<!--Rules-->
</rules>
<contexts>
<!--Contexts-->
</contexts>
</config>
The <config> element may bear the optional version attribute, which provides the major version number (i.e. a single integer value) +
<config xmlns="http://hcmc.uvic.ca/ns/staticSearch">
<params>
<!--Parameters-->
</params>
<rules>
<!--Rules-->
</rules>
<contexts>
<!--Contexts-->
</contexts>
</config>
The <config> element may bear the optional version attribute, which provides the major version number (i.e. a single integer value) of staticSearch that corresponds with the configuration file.
  • config (The root element for the Search Generator configuration file.) @@ -624,7 +624,7 @@

    8.5.3.1 Required param file, against the configuration file location) that points directly to the search page that will be the primary access point for the search. Since the search file must be at the root of the directory that you wish to index (i.e. the directory that contains - all of the XHTML you want the search to index), the searchFile parameter provides + all of the XHTML you want the search to index), the searchPage parameter provides the necessary information for knowing what document collection to index and where to put the output JSON. In other words, in specifying the location of your search page, you are also specifying the location of your document collection. See Creating a search page for more information on how to configure this file.

    @@ -923,8 +923,8 @@

    8.5.4 Specifying rules
    The <rules> elements specifies a list of conditions (using the <rule> element) that tell the parser, using XPath statements in the match attribute, specific weights to assign to particular parts of each document. For instance, if you wanted all heading elements (<h1>, <h2>, etc) in documents to be given a greater weight and thus receive a higher score in the results, you can do so using a rule like so: -
    <rules>
    <rule weight="2"
    match="h1 | h2 | h3 | h4 | h5 | h6"/>

    </rules>
    Since we're using XPath 3.0 and XSLT 3.0, this can also be simplified to: -
    <rules>
    <rule weight="2"
    match="*[matches(local-name(),'^h\d+$')]"/>

    </rules>
    (It is worth noting, however, the above example is unnecessary: all heading elements +
    <rules>
    <rule weight="2"
    match="h1 | h2 | h3 | h4 | h5 | h6"/>

    </rules>
    Since we're using XPath 3.0 and XSLT 3.0, this can also be simplified to: +
    <rules>
    <rule weight="2"
    match="*[matches(local-name(),'^h\d+$')]"/>

    </rules>
    (It is worth noting, however, the above example is unnecessary: all heading elements are given a weight of 2 by default, which is the only preconfigured weight in staticSearch.)

    The value of the match attribute is transformed in a XSLT template match attribute, and thus must follow the same rules (i.e. no complex rules like p/ancestor::div). See the W3C XSLT Specification for further details on allowable pattern rules.

    @@ -933,8 +933,8 @@

    8.5.4 Specifying rules index its contents on every page. These elements can be ignored simply by using a <rule> and setting its weight to 0. For instance, if you want to remove the header and the footer from the search indexing process, you could write something like: -
    <rule weight="0" match="footer | header"/>
    Or if you want to remove XHTML anchor tags (<a>) whose text is identical to the URL specified in its href, you could do something like: -
    <rule weight="0" match="a[@href=./text()]"/>
    +
    <rule weight="0" match="footer | header"/>
    Or if you want to remove XHTML anchor tags (<a>) whose text is identical to the URL specified in its href, you could do something like: +
    <rule weight="0" match="a[@href=./text()]"/>

Note that the indexer does not tokenize any content in the <head> of the document (but as noted in 8.1 Configuring your site: search filters, metadata can be configured into filters) and that all elements in the <body> of a document are considered tokenizable. However, common elements that you might want to exclude include:

@@ -971,22 +971,22 @@

8.5.5 Specifying conte
When the staticSearch creates the keywords-in-context strings (the "kwic" or "snippets") for each token, it does so by looking for the nearest block-level element that it can use as its context. Take, for instance, this unordered list: -
<ul>
<li>Keyword-in-context search results. This is also configurable, since including contexts
increases the size of the index.</li>
<li>Search filtering using any metadata you like, allowing users to limit their search +
<ul>
<li>Keyword-in-context search results. This is also configurable, since including contexts
increases the size of the index.</li>
<li>Search filtering using any metadata you like, allowing users to limit their search to specific
document types.</li>
</ul>
Each <li> elements is, by default, a context element, meaning that the snippet generated for each token will not extend beyond the <li> element boundaries; in this case, if the <li> was not a context attribute, the term ‘search’ would produce a context that looks something like: -
"...the size of the index.Search filtering using any metadata you like,..."
+
"...the size of the index.Search filtering using any metadata you like,..."
Using the <contexts> element, you can control what elements operate as contexts. For instance, say a page contained a marginal note, encoded as a <span> in your document beside its point of attachment:1 -
<p>About that program I shall have nothing to say here,<span class="sidenote">Some information on this subject can be found in "Second Thoughts"</span> [...]
</p>
Using CSS, the footnote might be alongside the text of the document in margin, or +
<p>About that program I shall have nothing to say here,<span class="sidenote">Some information on this subject can be found in "Second Thoughts"</span> [...]
</p>
Using CSS, the footnote might be alongside the text of the document in margin, or made into a clickable object using Javascript. However, since the tokenizer is unaware of any server-side processing, it understands the <span> as an inline element and assumes the <p> constitutes the context of the element. A search for ‘information’ might then return: -
"...nothing to say here,Some information on this subject can be found...
To tell the tokenizer that the <span> constitutes the context block for any of its tokens, use the <context> element with an match pattern: -
<contexts>
<context match="span[contains-token(@class,'sidenote')]"/>
</contexts>
+
"...nothing to say here,Some information on this subject can be found...
To tell the tokenizer that the <span> constitutes the context block for any of its tokens, use the <context> element with an match pattern: +
<contexts>
<context match="span[contains-token(@class,'sidenote')]"/>
</contexts>
You can also configure it the other way: if a <div>, which is by default a context block, should not be understood as a context block, then you can tell the parser to not consider it as such using context set to false: -
<contexts>
<context match="div" context="false"/>
</contexts>
+
<contexts>
<context match="div" context="false"/>
</contexts>

The default context elements are:

    @@ -1043,7 +1043,7 @@

    8.5.6 Specifying searc users to perform a search within only a particular component of the page. For instance, for a page structured like the journal article mentioned above, we could specify the abstract, the notes, and the document’s body like so: -
    <contexts>
    <context match="article[@id='article_content']"
    label="Article text only"/>

    <context match="div[contains-token(@class,'footnote')]"
    label="Notes only"/>

    <context match="section[@id='abstract']"
    label="Abstracts only"/>

    <context match="span[contains-token(@class,'inline-note')]"
    label="Notes only"/>

    </contexts>
    The generated search page will then contain a set of checkboxes derived from the +
    <contexts>
    <context match="article[@id='article_content']"
    label="Article text only"/>

    <context match="div[contains-token(@class,'footnote')]"
    label="Notes only"/>

    <context match="section[@id='abstract']"
    label="Abstracts only"/>

    <context match="span[contains-token(@class,'inline-note')]"
    label="Notes only"/>

    </contexts>
    The generated search page will then contain a set of checkboxes derived from the distinct label values. There is no requirement for the label values to be distinct, but any identical labels will be treated as identical contexts (i.e. in the example above, searching for a string within "Notes only" will return all results found within both the div elements with a class="footnote" and the span elements with class="inline-note".)

@@ -1083,12 +1083,12 @@

8.5.7 Specifying exclu contexts and rules. For example, imagine that you are creating a special search page that focuses only on the text describing images or figures in your documents. You might do it like this: -
<rules>
<rule match="text()[not(ancestor::div[@class='figure']or ancestor::title)]"
weight="0"/>

</rules>
This specifies that all text nodes which are not part of the document title or descendants +
<rules>
<rule match="text()[not(ancestor::div[@class='figure']or ancestor::title)]"
weight="0"/>

</rules>
This specifies that all text nodes which are not part of the document title or descendants of <div class="figure"> should be ignored (weight=0), so only your target nodes will be indexed.

However, it's also likely that you will want to exclude certain features or documents from a specialized search page, and this is done using the <excludes> section and its child <exclude> elements.

Here is an example: -
<excludes>
<!-- We only index files which have illustrations in them. -->
<exclude type="index"
match="html [not( descendant::meta [@name='Has illustration(s)'] [@content='true'] +
<excludes>
<!-- We only index files which have illustrations in them. -->
<exclude type="index"
match="html [not( descendant::meta [@name='Has illustration(s)'] [@content='true'] )]"/>

<!-- We ignore the document type filter, because we are only indexing one type of document anyway. -->
<exclude type="filter"
match="meta[ @name='Document type' ]"/>

<!-- We exclude the filter that specifies @@ -1106,11 +1106,11 @@

8.6 Creating a search also be well-formed XML, so it can be processed), containing all the site components you need, and then the search build process will insert all the necessary components into that file. The only requirement is that the page contains one <div> element with the correct id attribute: -
<div id="staticSearch">
[...content will be supplied by the build process...]
</div>
This <div> will be empty initially. The build process will find insert the search controls, +
<div id="staticSearch">
[...content will be supplied by the build process...]
</div>
This <div> will be empty initially. The build process will find insert the search controls, scripts and results <div> into this container. Then whenever you rebuild the search for your site, the contents will be replaced. There is no need to make sure it's empty every time.

The search process will also add a link to the staticSearch CSS file to the <head> of the document: -
<link rel="stylesheet"
href="staticSearch/ssSearch.css" id="ssCss"/>
You can customize this CSS by providing your own CSS that overrides it, using <style>, or <link>, placed after it in the <head> element, or by replacing the inserted CSS after the build process. Note that some +
<link rel="stylesheet"
href="staticSearch/ssSearch.css" id="ssCss"/>
You can customize this CSS by providing your own CSS that overrides it, using <style>, or <link>, placed after it in the <head> element, or by replacing the inserted CSS after the build process. Note that some features, like the ‘Show More’ widget or the ‘Searching’ loading dialog, rely on rules included in the base staticSearch CSS; if you do remove or disable the CSS, then some features may not work properly.

Note that once your file has been processed and all this content has been added, you @@ -1130,7 +1130,7 @@

8.7 Running the search

Before running the search on your own site, you can test that your system is able to do the build by doing the (very quick) build of the test materials. If you simply run the ant command, like this:

-
mholmes@linuxbox:~/Documents/staticSearch$ ant
+
mholmes@linuxbox:~/Documents/staticSearch$ ant

you should see a build process proceed using the small test collection of documents, and at the end, a results page should open up giving you a report on what was done. If this fails, then you'll need to troubleshoot the problem based on any error messages @@ -1140,7 +1140,7 @@

8.7 Running the search

If the tests all work, then you're ready to build a search for your own site. Now you need to run the same command, but this time, tell the build process where to find your custom configuration file:2

-
ant -DssConfigFile=/home/mholmes/mysite/config_staticSearch.xml
+
ant -DssConfigFile=/home/mholmes/mysite/config_staticSearch.xml

The same process should run, and if it's successful, you should have a modified search.html page as well as a lot of index files in JSON format in your site HTML folder. Now you can test your own search in the same ways suggested above.

@@ -1152,14 +1152,14 @@

8.8 Running staticSear using ssConfig or an absolute path using ssConfigFile). Assuming that the build file, your config file, and your staticSearch directory are all at the root of the project, you could call the staticSearch build in ant like so: -
<ant antfile="${basedir}/staticSearch"
inheritall="false">

<property name="ssConfig"
value="staticSearch_config.xml"/>

</ant>
+
<ant antfile="${basedir}/staticSearch"
inheritall="false">

<property name="ssConfig"
value="staticSearch_config.xml"/>

</ant>

Note that any arguments passed to ant at the command line arguments will be passed on to the staticSearch build. This can cause issues when the main build requires the use of the -lib parameter (since the project's version of Saxon may conflict, for instance, with the version used by staticSearch). If your build requires the use of the -lib parameter, then an alternative approach for calling staticSearch from your build is to use the exec task like so: -
<exec executable="ant" dir="staticSearch">
<arg value="-DssConfig=../config_staticSearch.xml"/>
</exec>
+
<exec executable="ant" dir="staticSearch">
<arg value="-DssConfig=../config_staticSearch.xml"/>
</exec>
@@ -1173,14 +1173,14 @@

8.9 Generated reportBy default, the report includes only basic information about the number of stem files created, the the filters used, and any problems encountered. However, if you run the build process using the additional parameter ssVerboseReport:

-
ant -DssVerboseReport=true -DssConfigFile=...
+
ant -DssVerboseReport=true -DssConfigFile=...

then the report will also include a number of tables that outline some statistics about your project. However, please note that compiling these statistics is very memory-intensive and if your site is large, it may cause the build process to run out of memory.

As of version 1.4, the word frequency table is a separate document and is no longer included as part of the verbose report. Instead, after running a build, you can then build just the word frequency table with the special concordance target:

-
ant -DssConfigFile=path/to/your/config.xml concordance
+
ant -DssConfigFile=path/to/your/config.xml concordance

While the chart itself is not necessary for the core functionality of staticSearch, it is particularly useful during the initial development of a project’s search engine; it can be used to create and fine-tune the project-specific stopword list (i.e. if @@ -1204,18 +1204,18 @@

8.10.1 Custom attribut result string (which is in the form of an HTML <li> element).

Imagine that some of the paragraphs in your documents are special in some way. You could add an attribute whose name begins with data-ss- to each of those paragraphs, like this: -
<p data-ss-type="special">This paragraph is special for some reason or other...</p>
When the staticSearch indexer creates KWIC extracts, it automatically harvests any +
<p data-ss-type="special">This paragraph is special for some reason or other...</p>
When the staticSearch indexer creates KWIC extracts, it automatically harvests any attribute whose name begins with data-ss- from the containing element or its ancestors, and adds them to the keyword-in-context record in the index. Then when that KWIC string is displayed as the result of a search, the attribute will be added to the HTML <li> element on the page: -
<li data-ss-type="special">[KWIC with marked search hit, link, etc.]</li>
This means that you can add your own CSS or JavaScript to make that KWIC appear distinct +
<li data-ss-type="special">[KWIC with marked search hit, link, etc.]</li>
This means that you can add your own CSS or JavaScript to make that KWIC appear distinct from other KWICs which come from non-special paragraphs.

You can add as many custom attributes as you like (although bear in mind that they increase the size of the index JSON files slightly and may add to the build time).

One specific custom attribute has built-in handling that you may find useful. If you add the attribute data-ss-img with a value that points to an image, that image will be displayed to the left of the KWIC string. For example, if you do this: -
<p data-ss-img="images/elephant.png">This paragraph is all about elephants...</p>
then any KWIC results from that paragraph will show the elephant.png image to the left of the KWIC text. This can be especially useful if your site contains +
<p data-ss-img="images/elephant.png">This paragraph is all about elephants...</p>
then any KWIC results from that paragraph will show the elephant.png image to the left of the KWIC text. This can be especially useful if your site contains large documents which are broken into sections, and those sections can be helpfully represented by images; the search results will be easier for the user to understand by virtue of the associated images. Image URLs should be relative to the location @@ -1340,7 +1340,7 @@

10 ‘ How do I get staticSearch to ignore large chunks of my document? Any element with a weight of 0 is ignored completely by the indexer, so add a <rule> for the element. So to ignore all elements with the class ignoreThisElement, you could do something like: -
<rule weight="0"
match="div[contains-token(@class, 'ignoreThisElement')"/>
+
<rule weight="0"
match="div[contains-token(@class, 'ignoreThisElement')"/>
@@ -1351,16 +1351,16 @@

10 ‘ How do I get staticSearch to ignore an element, but retain its text in the KWIC? Here, you'll want to use the <exclude> function, which excludes the element from indexing, but doesn't remove it from the document itself. So, if you wanted to exclude all keyboard entry items (<xh:kbd>), but still have them in the KWIC, you could do something like: -
<exclude match="kbd"
type="index"/>
+
<exclude match="kbd"
type="index"/>
How can I get staticSearch to show debugging messages? Set the ssVerbose property to true at the command line: -
ant -DssConfig=cfg.xml -DssVerbose=true 
Note that verbosity settings persist after creating the initial config; so, if you +
ant -DssConfig=cfg.xml -DssVerbose=true 
Note that verbosity settings persist after creating the initial config; so, if you are trying to debug just the tokenization process, you must make sure to run the config target beforehand: -
ant config tokenize -DssConfig=cfg.xml -DssVerbose=true 
+
ant config tokenize -DssConfig=cfg.xml -DssVerbose=true 
@@ -1372,7 +1372,7 @@

10 ‘ If you are indexing a very large collection of files, you may need to provide ant with additional memory by configuring the ANT_OPTS system property. To provide ant with 4GB of memory, you could do something like so: -
export ANT_OPTS="-Xmx4g"; ant -DjavaFork=false -DssConfigFile=/absolute/path/to/your/config.xml
How much memory you can and should provide to Ant depends on your particular system +
export ANT_OPTS="-Xmx4g"; ant -DjavaFork=false -DssConfigFile=/absolute/path/to/your/config.xml
How much memory you can and should provide to Ant depends on your particular system and the size of the document collection. See Ant's documentation for some further examples and explanation. The javaFork parameter prevents calls to Java processes (such as Saxon) from forking into a new Java VM, which allows them to take advantage of the expanded memory you have assigned to Ant. @@ -1403,9 +1403,9 @@

11 Programming with st the search page. This event carries additional information in its detail property: an integer which is the count of the number of hit documents found.

You can use these events in your code in the following way:

-
var showMessage = function(){ alert('The StaticSearch instance has been constructed!'); } window.addEventListener('ssInstantiated', showMessage); 
+
var showMessage = function(){ alert('The StaticSearch instance has been constructed!'); } window.addEventListener('ssInstantiated', showMessage); 

In the case of the ssSearchCompleted event, you could do this:

-
var showMessage = function(evt){ alert(evt.detail.hits + ' documents found!'); } window.addEventListener('ssSearchCompleted', showMessage); 
+
var showMessage = function(evt){ alert(evt.detail.hits + ' documents found!'); } window.addEventListener('ssSearchCompleted', showMessage); 
@@ -1448,7 +1448,7 @@

12.1 Changes in versio <verbose> 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 
+
ant -DssConfig=cfg.xml -DssVerbose=true 
@@ -1463,7 +1463,7 @@

12.1 Changes in versio 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; } 
+
.fidLink{ display:none; } 
@@ -1644,7 +1644,7 @@

Appendix A.1.1 <con -
<config version="1">
<params>
<!--Config options-->
</params>
</config>
+
<config version="1">
<params>
<!--Config options-->
</params>
</config>
@@ -1682,7 +1682,7 @@

Appendix A.1.1 <con Content model -
+                              
 <content>
  <sequence minOccurs="1" maxOccurs="1">
   <elementRef key="params"/>
@@ -1692,18 +1692,18 @@ 

Appendix A.1.1 <con <elementRef key="filters" minOccurs="0"/> </sequence> </content> -

+
Schema Declaration -
+                              
 element config
 {
    attribute version { text }?,
    ( params, rules?, contexts?, excludes?, filters? )
-}
+}
@@ -1805,24 +1805,24 @@

Appendix A.1.2 <con Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
+                              
 element context
 {
    att.match.attributes,
    att.labelled.attributes,
    attribute context { text }?,
    empty
-}
+}
@@ -1864,19 +1864,19 @@

Appendix A.1.3 <con Content model -
+                              
 <content>
  <elementRef key="context" minOccurs="0"
   maxOccurs="unbounded"/>
 </content>
-    
+
Schema Declaration -
-element contexts { context* }
+
+element contexts { context* }
@@ -1928,17 +1928,17 @@

Appendix A.1.4 <cre Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
+                              
 element createContexts
 {
    (
@@ -1953,7 +1953,7 @@ 

Appendix A.1.4 <cre ) ), empty -}

+}
@@ -2038,18 +2038,18 @@

Appendix A.1.5 <dic Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
-element dictionary { attribute file { text }, empty }
+
+element dictionary { attribute file { text }, empty }
@@ -2140,23 +2140,23 @@

Appendix A.1.6 <exc Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
+                              
 element exclude
 {
    att.match.attributes,
    attribute type { "index" | "filter" },
    empty
-}
+}
@@ -2199,19 +2199,19 @@

Appendix A.1.7 <exc Content model -
+                              
 <content>
  <elementRef key="exclude" minOccurs="1"
   maxOccurs="unbounded"/>
 </content>
-    
+
Schema Declaration -
-element excludes { exclude+ }
+
+element excludes { exclude+ }
@@ -2283,19 +2283,19 @@

Appendix A.1.8 <fil Content model -
+                              
 <content>
  <elementRef key="span" minOccurs="1"
   maxOccurs="unbounded"/>
 </content>
-    
+
Schema Declaration -
-element filter { attribute filterName { text }, span+ }
+
+element filter { attribute filterName { text }, span+ }
@@ -2339,19 +2339,19 @@

Appendix A.1.9 <fil Content model -
+                              
 <content>
  <elementRef key="filter" minOccurs="1"
   maxOccurs="unbounded"/>
 </content>
-    
+
Schema Declaration -
-element filters { filter+ }
+
+element filters { filter+ }
@@ -2510,18 +2510,18 @@

Appendix A.1.11 <ou Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
-element output { attribute dir { text }, empty }
+
+element output { attribute dir { text }, empty }
@@ -2564,7 +2564,7 @@

Appendix A.1.12 <pa Content model -
+                              
 <content>
  <elementRef key="searchPage"/>
  <elementRef key="index" minOccurs="0"/>
@@ -2580,14 +2580,14 @@ 

Appendix A.1.12 <pa <elementRef key="version" minOccurs="0"/> <elementRef key="output"/> </content> -

+
Schema Declaration -
-element params {  }
+
+element params {  }
@@ -2814,18 +2814,18 @@

Appendix A.1.14 <ru Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
-element rule { att.match.attributes, attribute weight { text }, empty }
+
+element rule { att.match.attributes, attribute weight { text }, empty }
@@ -2867,19 +2867,19 @@

Appendix A.1.15 <ru Content model -
+                              
 <content>
  <elementRef key="rule" minOccurs="1"
   maxOccurs="unbounded"/>
 </content>
-    
+
Schema Declaration -
-element rules { rule+ }
+
+element rules { rule+ }
@@ -2962,22 +2962,22 @@

Appendix A.1.16 <sc Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
+                              
 element scoringAlgorithm
 {
    attribute name { "raw" | "tf-idf" | "BM25" | "BM25L" }?,
    empty
-}
+}
@@ -3054,18 +3054,18 @@

Appendix A.1.17 <se Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
-element searchPage { attribute file { text }, empty }
+
+element searchPage { attribute file { text }, empty }
@@ -3131,7 +3131,7 @@

Appendix A.1.18 <sp Content model -
+                              
 <content>
  <alternate minOccurs="1"
   maxOccurs="unbounded">
@@ -3140,14 +3140,14 @@ 

Appendix A.1.18 <sp <textNode/> </alternate> </content> -

+
Schema Declaration -
-element span { attribute lang { text }?, ( anyElement_span_1* | text )+ }
+
+element span { attribute lang { text }?, ( anyElement_span_1* | text )+ }
@@ -3262,17 +3262,17 @@

Appendix A.1.19 <st Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
+                              
 element stemmer
 {
    attribute dir
@@ -3283,7 +3283,7 @@ 

Appendix A.1.19 <st | "stemmers/stripDiacritics" }, empty -}

+}
@@ -3371,18 +3371,18 @@

Appendix A.1.20 <st Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
-element stopwords { attribute file { text }, empty }
+
+element stopwords { attribute file { text }, empty }
@@ -3539,18 +3539,18 @@

Appendix A.1.22 <ve Content model -
+                              
 <content>
  <empty/>
 </content>
-    
+
Schema Declaration -
-element version { attribute file { text }, empty }
+
+element version { attribute file { text }, empty }
@@ -3686,21 +3686,21 @@

Appendix A.3.1 ssdata. Content model -
+                              
 <content>
  <valList>
   <valItem ident="true"/>
   <valItem ident="false"/>
  </valList>
 </content>
-    
+
Declaration -
-ssdata.boolean = "true" | "false"
+
+ssdata.boolean = "true" | "false"
@@ -3718,12 +3718,12 @@

Appendix A.3.1 ssdata.

-
Martin Holmes and Joey Takeda. Date: 2019-2025
+
Martin Holmes and Joey Takeda. Date: 2019–2026
diff --git a/schema/staticSearch.odd b/schema/staticSearch.odd index 079eac2a..0ed3b55a 100644 --- a/schema/staticSearch.odd +++ b/schema/staticSearch.odd @@ -28,7 +28,7 @@ Martin Holmes Joey Takeda - 2019-2025 + 2019–2026

This documentation provides instructions on how to use the Project Endings staticSearch Generator to provide a fully-functional search engine diff --git a/schema/staticSearch.rng b/schema/staticSearch.rng index 46e60ccf..0a65ec98 100644 --- a/schema/staticSearch.rng +++ b/schema/staticSearch.rng @@ -5,7 +5,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" ns="http://hcmc.uvic.ca/ns/staticSearch">