Skip to content

Commit

Permalink
Added year adv parameter support
Browse files Browse the repository at this point in the history
  • Loading branch information
bblaisATcoveo committed Sep 11, 2024
1 parent b06a10e commit ffc9710
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ function initEngine() {
statusController = buildSearchStatus( headlessEngine );

if ( urlParams.allq || urlParams.exctq || urlParams.anyq || urlParams.noneq || urlParams.fqupdate ||
urlParams.dmn || urlParams.fqocct || urlParams.elctn_cat || urlParams.filetype || urlParams.site ) {
urlParams.dmn || urlParams.fqocct || urlParams.elctn_cat || urlParams.filetype || urlParams.site || urlParams.year ) {
let q = [];
let qString = "";
if ( urlParams.allq ) {
Expand Down Expand Up @@ -603,6 +603,13 @@ function initEngine() {
}
}

if ( urlParams.year ) {
const year = Number.parseInt( urlParams.year )
if ( Number.isInteger( year ) && ( year > 2000 ) && ( year < 2250 )) {
aqString += ' @uri=".ca/' + urlParams.year + '"';
}
}

if ( urlParams.site ) {
let site = urlParams.site.toLowerCase().replace( '*', '' );
aqString += ' @canadagazettesite==' + site;
Expand Down

0 comments on commit ffc9710

Please sign in to comment.