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