Skip to content

Commit

Permalink
update Nosketch search box to add more than 1 word in CQL query + upd…
Browse files Browse the repository at this point in the history
…ate typo in register card
  • Loading branch information
Lucaterre committed May 27, 2024
1 parent 399a940 commit 30db0f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/RegisterCardNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<p class="main-label">{{ mainLabel }}</p>
<hr>
<p class="ressource-title">Accéder aux ressources</p>
<p>Lien vers la salle de lecture virtuelle des AN : <a :href="AnSivLink" target="_blank">ici</a>
<p>Lien vers la salle de lecture virtuelle des Archives nationales : <a :href="AnSivLink" target="_blank">ici</a>
</p>
<p>Lien vers le fac-similé du registre {{ volume }} : <router-link :to="`/facsimile/${volume}/1`" @click="navigateToFacSimile">ici</router-link></p>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/components/RegisterNoSketchSearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export default {
* @returns {string}
*/
_prepareNoSketchRequest() {
let cqlQuery = encodeURIComponent(`[word="${this.NoSketchTermSearch}"] within <doc (date >="${this.yearRange[0]}") & (date<="${this.yearRange[1]}") />`);
let wordsSplitted = this.NoSketchTermSearch.split(" ");
let wordsPrepared = wordsSplitted.map(word => `[word="${word}"]`).join("")
// if wordsPrepared contains [word=""] then we remove all occurences be careful to Unnecessary escape character: \"
wordsPrepared = wordsPrepared.replace(/\[word=""]/g, "");
let cqlQuery = encodeURIComponent(`${wordsPrepared} within <doc (date >="${this.yearRange[0]}") & (date<="${this.yearRange[1]}") />`);
let baseNoSketchUrl = `${this.noSketchService}#concordance`;
let queryParams = `corpname=endp&tab=advanced&queryselector=cql&attrs=word&viewmode=kwic&attr_allpos=all&refs_up=0&shorten_refs=1&glue=1&gdexcnt=300&show_gdex_scores=0&itemsPerPage=20&structs=s%2Cg&refs=%3Ddoc.id&default_attr=word&cql=${cqlQuery}&showresults=1&showTBL=0&tbl_template=&gdexconf=&f_tab=basic&f_showrelfrq=1&f_showperc=0&f_showreldens=0&f_showreltt=0&c_custom=`;
return `${baseNoSketchUrl}?${queryParams}`;
Expand Down
4 changes: 2 additions & 2 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ module.exports = {
devServer: {
port: 9091,
},
// publicPath: process.env.NODE_ENV === 'production' ? "/endp" : "/"
publicPath: process.env.NODE_ENV === 'production' ? "/" : "/"
publicPath: process.env.NODE_ENV === 'production' ? "/endp" : "/"
// publicPath: process.env.NODE_ENV === 'production' ? "/" : "/"
}

0 comments on commit 30db0f5

Please sign in to comment.