155 |
155 |
allFqs += fq;
|
156 |
156 |
}
|
157 |
157 |
}
|
|
158 |
if(this.connectCommunityId ){
|
|
159 |
allFqs+= "&fq=communityId exact " + StringUtils.quote(StringUtils.URIEncode(this.connectCommunityId ));
|
|
160 |
}
|
|
161 |
|
158 |
162 |
var keyword = params['keyword'];
|
159 |
163 |
var doiQuery = "";
|
160 |
164 |
var keywordQuery = "";
|
... | ... | |
202 |
206 |
}
|
203 |
207 |
|
204 |
208 |
}
|
|
209 |
if(this.connectCommunityId ){
|
|
210 |
allFqs+= "&fq=communityId exact " + StringUtils.quote(StringUtils.URIEncode(this.connectCommunityId ));
|
|
211 |
}
|
205 |
212 |
var keyword = params['keyword'];
|
206 |
213 |
var doiQuery = "";
|
207 |
214 |
var keywordQuery = "";
|
... | ... | |
285 |
292 |
if(filteredValues.length > 0){
|
286 |
293 |
filter.values = filteredValues;
|
287 |
294 |
}
|
288 |
|
}else if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1 ){
|
289 |
|
var filteredValues = [];
|
290 |
|
for(let filterValue of filter.values) {
|
291 |
|
if(this.connectCommunityId != filterValue.id){
|
292 |
|
filteredValues.push(filterValue);
|
293 |
|
}else{
|
294 |
|
filter.countSelectedValues-- ;
|
295 |
|
}
|
296 |
|
}
|
297 |
|
if(filteredValues.length > 0){
|
298 |
|
filter.values = filteredValues;
|
299 |
|
}
|
300 |
|
}
|
|
295 |
}
|
|
296 |
// else if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1 ){
|
|
297 |
// var filteredValues = [];
|
|
298 |
// for(let filterValue of filter.values) {
|
|
299 |
// if(this.connectCommunityId != filterValue.id){
|
|
300 |
// filteredValues.push(filterValue);
|
|
301 |
// }else{
|
|
302 |
// filter.countSelectedValues-- ;
|
|
303 |
// }
|
|
304 |
// }
|
|
305 |
// if(filteredValues.length > 0){
|
|
306 |
// filter.values = filteredValues;
|
|
307 |
// }
|
|
308 |
// }
|
301 |
309 |
}
|
302 |
310 |
|
303 |
311 |
return filters;
|
... | ... | |
321 |
329 |
|
322 |
330 |
for (let filter of filters){
|
323 |
331 |
var filterLimits="";
|
324 |
|
if(filter.countSelectedValues > 0 || (this.connectCommunityId && filter.filterId.indexOf("community")!=-1)){
|
|
332 |
if(filter.countSelectedValues > 0 ){//|| (this.connectCommunityId && filter.filterId.indexOf("community")!=-1)){
|
325 |
333 |
for (let value of filter.values){
|
326 |
334 |
if(value.selected == true){
|
327 |
335 |
filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(value.id)+'"';
|
328 |
336 |
}
|
329 |
337 |
}
|
330 |
|
if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1 ){
|
331 |
|
filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(this.connectCommunityId)+'"';
|
332 |
|
}
|
|
338 |
// if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1 ){
|
|
339 |
// filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(this.connectCommunityId)+'"';
|
|
340 |
// }
|
333 |
341 |
this.queryParameters.set(filter.filterId,filterLimits);
|
334 |
342 |
if(filterLimits.length > 0){
|
335 |
343 |
this.parameterNames.push(filter.filterId);
|
... | ... | |
355 |
363 |
private createSearchQueryParameters(filters:Filter[]){ // called by goTo, result emited to and used by search find pages
|
356 |
364 |
var allFqs = "";
|
357 |
365 |
for (let filter of filters){
|
358 |
|
if(filter.countSelectedValues > 0 || (this.connectCommunityId && filter.filterId.indexOf("community")!=-1)){
|
|
366 |
if(filter.countSelectedValues > 0 ){//|| (this.connectCommunityId && filter.filterId.indexOf("community")!=-1)){
|
359 |
367 |
var fq = "";
|
360 |
368 |
var count_selected=0;
|
361 |
369 |
for (let value of filter.values){
|
... | ... | |
364 |
372 |
fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + StringUtils.quote(StringUtils.URIEncode(value.id));
|
365 |
373 |
}
|
366 |
374 |
}
|
367 |
|
if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1){
|
368 |
|
count_selected++;
|
369 |
|
fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + StringUtils.quote(StringUtils.URIEncode(this.connectCommunityId));
|
370 |
|
}
|
|
375 |
// if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1){
|
|
376 |
// count_selected++;
|
|
377 |
// fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + StringUtils.quote(StringUtils.URIEncode(this.connectCommunityId));
|
|
378 |
// }
|
371 |
379 |
fq="&fq="+fq;
|
372 |
380 |
allFqs += fq;
|
373 |
381 |
}
|
374 |
382 |
}
|
|
383 |
if(this.connectCommunityId ){
|
|
384 |
allFqs+= "&fq=communityId exact " + StringUtils.quote(StringUtils.URIEncode(this.connectCommunityId ));
|
|
385 |
}
|
375 |
386 |
//TODO --
|
376 |
387 |
var doiQuery = "";
|
377 |
388 |
var keywordQuery = "";
|
... | ... | |
392 |
403 |
keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword);
|
393 |
404 |
}
|
394 |
405 |
}
|
395 |
|
|
396 |
406 |
return (doiQuery.length > 0 ? doiQuery:keywordQuery) + allFqs;
|
397 |
407 |
|
398 |
408 |
}
|
change the query for community in search pages of pub/data/soft