You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-10Lines changed: 22 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,23 +21,23 @@ The goal is to continue to refine and improve this code base on a regular basis.
21
21
22
22
### Improvement plan
23
23
24
-
To manage development activities related to this project, a standard internal issue tracking system used at Principal Publisher will be used. Also, regular touchpoints with the search vendor, as well as formal service requests entered through their portal, could also spark some development activities from a vendor perspective.
24
+
To manage development activities related to this project, a standard internal issue tracking system used at Principal Publisher will be used. Also, regular touchpoints with the search vendor, as well as formal service requests entered through their portal, could spark development activities from the vendor's team.
25
25
26
26
Example of code contributions may be related to:
27
27
28
28
- development/configurations of AI-powered features and other innovations
29
29
- bug fixes, accessibility and security improvements
30
30
- project maintenance chores
31
31
32
-
For more details, please [consult full checklist of to do items](todo.md).
32
+
For more details, please [consult the checklist of "to do" items](todo.md).
33
33
34
34
## Releases and API
35
35
36
36
All changes contributed through Pull requests will be packaged as releases. Releases are completed through the "Releases" tab in this GitHub repository; then, deployment to MWS follows the reguar release management cycle accordingly.
37
37
38
-
Each new verion of this project is defined based on an evaluaton of the impacts of changes against any formerly up-to-date LIVE Search UI implementation on Canada.ca. The scope constitutes of all files within the "dist" folder (distribution files), which are JavaScript scripts and CSS styles. Additionally, volume of usage for features can also be taken into consideration as part of the evaluation of impact on versioning. For example, an interactive feature from the Javascript which is known by certitude to have never been used in a production environment, wouldn't cause any breaking change if modified and therefore, wouldn't generate a major version.
38
+
Each new verion of this project is defined based on an evaluaton of the impacts of changes against any formerly up-to-date LIVE Search UI implementation on Canada.ca. The scope constitutes of all files within the "dist" folder (distribution files), which are JavaScript scripts and CSS style sheets. Additionally, volume of usage for features can also be taken into consideration as part of the evaluation of impact on versioning. For example, an interactive feature from the Javascript which is known by certitude to have never been used in a production environment, wouldn't cause any breaking change if modified and therefore, wouldn't generate a major version necessarily.
Aside from the evaluation based on usage, Search UI follows [Semantic Versioning 2.0.0](https://semver.org/)
41
41
42
42
---
43
43
@@ -138,15 +138,15 @@ For example, to override the search results template, you would do something alo
138
138
Template override should technically only be used on a few instances of the search pages. If all pages would benefit from a template override, then the recommended action would be to modify the default template HTML code at the source through a pull request.
139
139
140
140
-`sr-single`
141
-
: Template for all search results individually
141
+
: Template for all search results individually; your custom template MUST include an hyperlink with the class `result-link`, which SHOULD also include the data attribute `data-dtm-srchlnknm` for analytis tracking
142
142
-`sr-nores`
143
-
: For when there is no results to show
143
+
: For when there is no results to show; your custom template MUST include a heading of level H2
144
144
-`sr-error`
145
-
: For when an error occurs in the communication between the search page and the search engine
145
+
: For when an error occurs in the communication between the search page and the search engine; your custom template MUST include a heading of level H2
146
146
-`sr-query-summary`
147
-
: For the summary zone above the search results. Recommended to include an H2 tag for accessibility purposes
147
+
: For the summary zone above the search results; your custom template MUST include a heading of level H2
148
148
-`sr-noquery-summary`
149
-
: For the summary zone above the search results on advanced search pages. Recommended to include an H2 tag for accessibility purposes
149
+
: For the summary zone above the search results on advanced search pages; your custom template MUST include a heading of level H2
150
150
-`sr-did-you-mean`
151
151
: For the "Did you mean" suggestion section
152
152
-`sr-pager-previous`
@@ -157,6 +157,8 @@ Template override should technically only be used on a few instances of the sear
157
157
: For the next page button
158
158
-`sr-pager-container`
159
159
: For the wrapper of all pagniation button
160
+
-`sr-qs-hint`
161
+
: Message announced to screen reader to provide instructions on QS
160
162
161
163
As demonstrated in the example above, and by looking at the default templates, you'll notice that some variables can be used within the templates to be replaced by dynamic content coming from the search engine's API response.
162
164
@@ -196,6 +198,10 @@ Here is the extensive list of what variables can be used in templates:
196
198
: returns what the search engine considers a better search query in case a low amount or zero results show (based on criteria handled within the serach engine). To be used on Did you mean template
197
199
-`page`
198
200
: returns page number. To be used on Pagination template
201
+
-`result.raw.disp_declared_type`
202
+
: returns name of the declared type as defined in the meta data of the page (specific to News items)
203
+
-`result.raw.description`
204
+
: returns the meta description of the pages in the results; can be displayed instead of the default "matches excerpt".
199
205
200
206
#### Parameters
201
207
@@ -218,7 +224,7 @@ Sometimes your search pages contain more than one input relevant to the search's
218
224
-`dmn`
219
225
: Search for search terms in input, only on a specific domain
220
226
-`sort`
221
-
: Sort search results based on different criteria. Options are: by relevance (default when undefined) or by date when parameter is set
227
+
: Sort search results based on different criteria. Options are: by relevance (default when undefined) or by date when parameter is set to `descending` or `ascending`
222
228
-`elctn_cat`
223
229
: Used specifically for Elections Canada, to define a scope of search amongst their collection. See **/src/connector.js** to see all the options available
224
230
-`site`
@@ -229,6 +235,12 @@ Sometimes your search pages contain more than one input relevant to the search's
229
235
: Search , within documents of a certain file type. Options are: `application/pdf`, `ps`, `application/msword`, `application/vnd.ms-excel`, `application/vnd.ms-powerpoint`, `application/rtf`
230
236
-`originLevel3`
231
237
: Allows for mimicking a specific search page/context by setting its path through this URL parameter; this takes precedence over the configuration through data attribute
238
+
-`startdate`
239
+
: returns results that have a date meta data higher than or equal to the date provided
240
+
-`enddate`
241
+
: returns results that have a date meta data lower than or equal to the date provided
242
+
-`declaredtype`
243
+
: returns results based on the type provided, mapped to disp_declared_type behind the scenes (specific to News items)
Copy file name to clipboardExpand all lines: index.html
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,17 @@
1
1
---
2
2
title: Search user interface (UI) with Headless
3
3
lang: en
4
-
dateModified: 2025-08-04
4
+
dateModified: 2025-11-03
5
5
---
6
6
7
7
<pclass="lead">This is a demo site for the GC Search UI.</p>
8
8
9
-
<h2id="test">Test pages</h2>
10
-
<p>To test search pages, please make sure you <ahref="test/index.html">have a valid token</a>.</p>
9
+
<h2id="test">Working examples</h2>
10
+
11
+
<divclass="alert alert-info" role="alert">
12
+
<h3>Before you test</h3>
13
+
<p>To properly test pages below, such as getting results back from the search engine, please make sure you <ahref="test/index.html">have a valid token</a>.</p>
0 commit comments