Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

Context Search - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Changes for page Context Search

Last modified by bougault on 2023/02/20 16:29

From version 31.6
edited by bougault
on 2023/01/11 14:47
Change comment: There is no comment for this version
To version 30.3
edited by bougault
on 2023/01/11 14:30
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -66,24 +66,22 @@
66 66   }
67 67   handleSearch(textSearch) {
68 68   if(this.searchText !== "" || textSearch) {
69 - // if(this.searchText !== this.prevSearchText) {
69 + if(this.searchText !== this.prevSearchText) {
70 70   this.clearResults();
71 71   this.prevSearchText = this.searchText;
72 72   this.fetchWikiSearch().then(results => {
73 - console.log('results', results);
74 - //this.resultsCache = results;
73 + this.resultsCache = results;
75 75   if(this.hasActiveFilters()) {
76 76   this.fetchFilterSearch().then(this.filterResults);
77 77   } else {
78 - this.results = results ? results : [];
77 + this.results = results;
79 79   }
80 80   })
81 - /*} else if (this.searchText === this.prevSearchText && this.hasActiveFilters()) {
80 + } else if (this.searchText === this.prevSearchText && this.hasActiveFilters()) {
82 82   this.fetchFilterSearch().then(this.filterResults)
83 83   } else {
84 84   this.results = this.resultsCache;
85 85   }
86 - */
87 87   } else {
88 88   this.clearResults();
89 89   console.log("no search text, should return filter search results if any");
... ... @@ -153,7 +153,7 @@
153 153   }
154 154   customElements.define('clb-unified-search', UnifiedSearch);
155 155  
156 - function handleXWikiSearch(searchString, offset, nb) {
154 + function handleXWikiSearch(searchString) {
157 157   return new Promise((resolve) => {
158 158   require(['jquery'], function($) {
159 159   const solrServiceURL = new XWiki.Document('SuggestSolrService', 'XWiki').getURL('get');
... ... @@ -161,8 +161,8 @@
161 161   $.get(solrServiceURL, {
162 162   outputSyntax: 'plain',
163 163   media: 'json',
164 - nb: nb,
165 - offset: offset,
162 + nb:100,
163 + offset:10,
166 166   query: [
167 167   'q="__INPUT__"~100',
168 168   'fq=type:DOCUMENT',