| ... |
... |
@@ -1,5 +1,5 @@ |
| 1 |
|
-{{html clean="false"}} |
| 2 |
|
-<!-- |
|
1 |
+ |
|
2 |
+{{html clean="false"}}<!-- |
| 3 |
3 |
!!! POC. Code must be reviewed / optimized and packaged for use in production !!! |
| 4 |
4 |
!!! Many optimisations can be done !!! |
| 5 |
5 |
--> |
| ... |
... |
@@ -27,11 +27,6 @@ |
| 27 |
27 |
a { |
| 28 |
28 |
color: var(--color-brand-primary, blue); |
| 29 |
29 |
} |
| 30 |
|
- .rawResults { |
| 31 |
|
- display: flex; |
| 32 |
|
- font-size: 12px; |
| 33 |
|
- margin-top: 2em; |
| 34 |
|
- } |
| 35 |
35 |
`; |
| 36 |
36 |
constructor() { |
| 37 |
37 |
super(); |
| ... |
... |
@@ -98,10 +98,7 @@ |
| 98 |
98 |
fetchFilterSearch() { |
| 99 |
99 |
return new Promise((resolve) => { |
| 100 |
100 |
if(this.hasActiveFilters()) { |
| 101 |
|
- fetch(this.filterUrl).then(res => res.json()).then((res) => { |
| 102 |
|
- this.collabFiltersResults = res; |
| 103 |
|
- resolve(res); |
| 104 |
|
- }); |
|
96 |
+ fetch(this.filterUrl).then(res => res.json()).then((res) => resolve(res)); |
| 105 |
105 |
} else { |
| 106 |
106 |
resolve([]); |
| 107 |
107 |
} |
| ... |
... |
@@ -144,17 +144,6 @@ |
| 144 |
144 |
</div> |
| 145 |
145 |
`)} |
| 146 |
146 |
</div> |
| 147 |
|
- <div class="rawResults"> |
| 148 |
|
- <div> |
| 149 |
|
- <strong>XWiki Search Results</strong> |
| 150 |
|
- <pre>${JSON.stringify(this.resultsCache, null, 2)}</pre> |
| 151 |
|
- </div> |
| 152 |
|
- <div> |
| 153 |
|
- <strong>Collab Search Results (Filters)</strong> |
| 154 |
|
- <pre>${JSON.stringify(this.collabFiltersResults, null, 2)}</pre> |
| 155 |
|
- </div> |
| 156 |
|
- </div> |
| 157 |
|
-</div> |
| 158 |
158 |
` |
| 159 |
159 |
} |
| 160 |
160 |
} |
| ... |
... |
@@ -165,9 +165,10 @@ |
| 165 |
165 |
require(['jquery'], function($) { |
| 166 |
166 |
const solrServiceURL = new XWiki.Document('SuggestSolrService', 'XWiki').getURL('get'); |
| 167 |
167 |
//contextSearchButton.addEventListener('click', function() { |
| 168 |
|
- $.post(solrServiceURL, { |
|
149 |
+ $.get(solrServiceURL, { |
| 169 |
169 |
outputSyntax: 'plain', |
| 170 |
170 |
media: 'json', |
|
152 |
+ nb:1000, |
| 171 |
171 |
query: [ |
| 172 |
172 |
'q="__INPUT__"~100', |
| 173 |
173 |
'fq=type:DOCUMENT', |
| ... |
... |
@@ -181,5 +181,4 @@ |
| 181 |
181 |
} |
| 182 |
182 |
}); |
| 183 |
183 |
</script> |
| 184 |
|
-<clb-unified-search></clb-unified-search> |
| 185 |
|
-{{/html}} |
|
166 |
+<clb-unified-search></clb-unified-search>{{/html}} |