diff --git a/claims/claim-utils/claimResultSearchForm.component.ts b/claims/claim-utils/claimResultSearchForm.component.ts
index 5f7a0273..19a4979a 100644
--- a/claims/claim-utils/claimResultSearchForm.component.ts
+++ b/claims/claim-utils/claimResultSearchForm.component.ts
@@ -10,6 +10,10 @@ import {EnvProperties} from '../../utils/properties/env-properties';
import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.class";
import {Observable, forkJoin} from "rxjs";
import 'rxjs/add/observable/forkJoin'
+import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component";
+import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class";
+import {SearchUtilsClass} from "../../searchPages/searchUtils/searchUtils.class";
+import {SearchFields} from "../../utils/properties/searchFields";
@Component({
selector: 'claim-result-search-form',
templateUrl: 'claimResultSearchForm.component.html',
@@ -62,15 +66,15 @@ export class ClaimResultSearchFormComponent {
// public openaireRefineFields: string[] = ["relfunder", "relproject", "resultbestaccessright", "instancetypename", "resultlanguagename", "community"];
// public openaireRefineFieldsQuery: string = "&refine=true&fields=relfunder&fields=relproject&fields=resultacceptanceyear&fields=resultbestaccessright&fields=instancetypename&fields=resultlanguagename&fields=community";
- public openaireRefineFields: string[] = ["relfunder", "resultbestaccessright", "instancetypename"];
- public openaireRefineFieldsQuery: string = "&refine=true&fields=relfunder&fields=resultbestaccessright&fields=instancetypename";
+ public openaireRefineFields: string[] = ["resulttypeid","relfunder", "resultbestaccessright", "instancetypename"];
+ public openaireRefineFieldsQuery: string = "&refine=true&fields=resulttypeid&fields=relfunder&fields=resultbestaccessright&fields=instancetypename";
// public fieldIdsMap=this.searchFields.RESULT_FIELDS;
openaireResults: ClaimEntity[] = [];
openaireResultsNum: number;
openaireResultsPage: number = 1;
openaireResultsStatus: number = this.errorCodes.NONE;
- openaireResultsType = "publication";
+ // openaireResultsType = "publication";
orcidResults: ClaimEntity[];
orcidResultsNum: number;
@@ -91,6 +95,18 @@ export class ClaimResultSearchFormComponent {
reloadDatacite: boolean = false;
reloadOrcid: boolean = false;
+ //new search
+ quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
+ filter: null,
+ selected: true,
+ filterId: "resultbestaccessright",
+ value: "Open Access"
+ };
+
+ resultTypes = {publication: true, dataset: true, software: true, other: true};
+ public rangeFilters: RangeFilter[] = [];
+ public searchFields: SearchFields = new SearchFields();
+ public rangeFields:string[][] = this.searchFields.RESULT_RANGE_FIELDS;
constructor(private _searchDataciteService: SearchDataciteService,
private _searchCrossrefService: SearchCrossrefService,
private _searchOrcidService: SearchOrcidService,
@@ -98,7 +114,7 @@ export class ClaimResultSearchFormComponent {
const myDate = new Date();
this.todayDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
this.nextDate = (myDate.getFullYear() + 100) + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
-
+ this.rangeFilters = RangeFilter.parse(this.rangeFields,"result");
}
ngOnInit() {
@@ -164,16 +180,7 @@ export class ClaimResultSearchFormComponent {
}
searchOpenaire(keyword, size, page, keywordChanged) {
-
- if (keywordChanged) {
- this.callOpenaireService(keyword, size, page, (this.openaireResultsType == "publication"),"publication");
- this.callOpenaireService(keyword, size, page, (this.openaireResultsType == "dataset"),"dataset");
- this.callOpenaireService(keyword, size, page, (this.openaireResultsType == "software"),"software");
- this.callOpenaireService(keyword, size, page, (this.openaireResultsType == "other"),"other");
- } else {
- this.callOpenaireService(keyword, size, page, (this.openaireResultsType == this.openaireResultsType),this.openaireResultsType );
-
- }
+ this.searchResearchResults("publication", keyword, size, page, true, "publication");
}
private getCrossrefResults(term: string, size: number, page: number) {
@@ -261,7 +268,7 @@ export class ClaimResultSearchFormComponent {
}
}
- private callOpenaireService(term: string, size: number, page: number, mainResults: boolean, type) {
+ /*private callOpenaireService(term: string, size: number, page: number, mainResults: boolean, type) {
if (mainResults) {
this.openaireResultsStatus = this.errorCodes.LOADING;
this.openaireResultsPrevFilters = this.openaireResultsfilters;
@@ -281,10 +288,13 @@ export class ClaimResultSearchFormComponent {
}
- }
+ }*/
public searchResearchResults(resultType: string, term: string, size: number, page: number, mainResults: boolean, type) {
- this._searchResearchResultsService.search(resultType, this.createOpenaireQueryParams(), (mainResults && page==1 ?this.openaireRefineFieldsQuery:null), (mainResults?page:1), (mainResults?size:0), "", (mainResults && page==1 ?this.openaireRefineFields:[]), this.properties).subscribe(
+ this.openaireResultsStatus = this.errorCodes.LOADING;
+ this.openaireResultsPrevFilters = this.openaireResultsfilters;
+ this.openaireResultsNum = 0;
+ this._searchResearchResultsService.advancedSearchResults('publication', this.createOpenaireQueryParams(), page, size, null, this.properties, this.createOpenaireRefineQueryParams(), (page==1 ?this.openaireRefineFields:[]), (page==1 ?this.openaireRefineFieldsQuery:null)).subscribe(
data => {
this.setOpenaireResults(data, mainResults, page, type);
},
@@ -296,10 +306,10 @@ export class ClaimResultSearchFormComponent {
public setOpenaireResults(data, mainResults: boolean, page, type) {
if (data != null) {
- if (mainResults) {
+
this.openaireResultsPage = page;
this.openaireResultsNum = data[0];
- this.setOpenaireResultsCount(type, this.openaireResultsNum);
+ // this.setOpenaireResultsCount(type, this.openaireResultsNum);
if(data[2] && data[2].length > 0){
this.openaireResultsfilters = this.checkSelectedFilters(data[2], this.openaireResultsPrevFilters)
}
@@ -308,11 +318,6 @@ export class ClaimResultSearchFormComponent {
if (this.openaireResultsNum == 0) {
this.openaireResultsStatus = this.errorCodes.NONE;
}
- } else {
- this.setOpenaireResultsCount(type, data[0]);
- }
- this.totalOpenaireCount +=+data[0];
-
} else {
if (mainResults) {
this.openaireResultsStatus = this.errorCodes.ERROR;
@@ -563,7 +568,7 @@ export class ClaimResultSearchFormComponent {
createOpenaireQueryParams():string {
let query = "";
- if (this.DOIs.length > 0) {
+/* if (this.DOIs.length > 0) {
let doisParams = "";
for (let i = 0; i < this.DOIs.length; i++) {
doisParams += (doisParams.length > 0 ? "&" : "") + 'doi="' + this.DOIs[i] + '"';
@@ -571,11 +576,17 @@ export class ClaimResultSearchFormComponent {
query += doisParams;
} else if(this.keyword.length > 0){
query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword));
- }
- if(this.openaireYear.length > 0 ){
- query+='&fq=resultacceptanceyear exact \"'+this.openaireYear+'\"'
- }
+ }*/
+ if(this.keyword.length>0){
+ query+=NewSearchPageComponent.createKeywordQuery("result",this.keyword,"q","=");
+ }
+ return query;
+ }
+ createOpenaireRefineQueryParams():string {
let allFqs = "";
+ if(this.openaireYear.length > 0 ){
+ allFqs+='&fq=resultacceptanceyear exact \"'+this.openaireYear+'\"'
+ }
for (let filter of this.openaireResultsfilters){
if(filter.countSelectedValues > 0){
let count_selected=0;
@@ -592,7 +603,30 @@ export class ClaimResultSearchFormComponent {
}
}
}
- return query+allFqs;
+ for (let i=0; i
=" ,"<=", "and" )
+ }
+
+ if(this.resultTypes.publication && this.resultTypes.dataset && this.resultTypes.software && this.resultTypes.other){
+ allFqs += "&type=results";
+ }else{
+ if(this.resultTypes.publication) {
+ allFqs += "&type=publications";
+ }
+ if(this.resultTypes.dataset) {
+ allFqs += "&type=datasets";
+ }
+ if(this.resultTypes.software) {
+ allFqs += "&type=software";
+ }
+ if(this.resultTypes.other) {
+ allFqs += "&type=other";
+ }
+
+ }
+ return allFqs;
}
@@ -707,8 +741,8 @@ export class ClaimResultSearchFormComponent {
}
}
- public openaireTypeChanged(type) {
- this.openaireResultsType = type;
+ public openaireTypeChanged() {
+ // this.openaireResultsType = type;
this.reloadOpenaire = true;
this.openaireYear = "";
this.openaireResultsfilters = [];
@@ -750,8 +784,8 @@ export class ClaimResultSearchFormComponent {
if (value.selected == true) {
value.selected = false;
}
- this.search(false);
-
+ // this.search(false);
+ this.filterChanged(null);
}
public countFilters(): number {
@@ -761,10 +795,11 @@ export class ClaimResultSearchFormComponent {
filters += filter.countSelectedValues;
}
}
- if (this.keyword.length > 0) {
- filters++;
+ for (let filter of this.rangeFilters) {
+ if (filter.selectedFromValue || filter.selectedToValue) {
+ filters += 1;
+ }
}
-
return filters;
}
@@ -777,9 +812,21 @@ export class ClaimResultSearchFormComponent {
this.openaireResultsfilters[i].countSelectedValues = 0;
}
}
-
+ for(let filter of this.rangeFilters){
+ this.removeRangeFilter(filter);
+ }
+ this.filterChanged(null);
+ }
+ dateFilterChanged(filter:RangeFilter) {
+ if (filter.selectedFromValue && filter.selectedToValue) {
+ filter.selectedFromAndToValues = filter.selectedFromValue + "-" + filter.selectedToValue;
+ } else if (filter.selectedFromValue) {
+ filter.selectedFromAndToValues = "From " + filter.selectedFromValue;
+ } else if (filter.selectedToValue) {
+ filter.selectedFromAndToValues = "Until " + filter.selectedToValue;
+ }
+ this.filterChanged(null);
}
-
filterChanged($event) {
// console.log("filterChanged");
this.reloadOpenaire = true;
@@ -822,7 +869,7 @@ export class ClaimResultSearchFormComponent {
}
return totalPages;
}
- getTotalOpenaireNumber():number{
+/* getTotalOpenaireNumber():number{
let count = 0;
for(let i=0; i
-
+
+
0" [texts]="pageContents['bottom']">
diff --git a/searchPages/find/search.component.ts b/searchPages/find/search.component.ts
index 19bbcb2b..d1f8ab61 100644
--- a/searchPages/find/search.component.ts
+++ b/searchPages/find/search.component.ts
@@ -96,7 +96,7 @@ export class SearchComponent {
@Input() name;
@Input() customFilter: SearchCustomFilter = null;
@Input() piwikSiteId = null;
- @Input() formPlaceholderText = "Search for research results, projects, content providers & organizations in OpenAIRE";
+ @Input() formPlaceholderText = "Search for research outcomes, projects, content providers & organizations in OpenAIRE";
public subPub;
diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts
index 7353bceb..f27ddc78 100644
--- a/searchPages/find/searchAll.component.ts
+++ b/searchPages/find/searchAll.component.ts
@@ -93,7 +93,7 @@ export class SearchAllComponent {
@Input() name;
@Input() customFilter: SearchCustomFilter = null;
@Input() piwikSiteId = null;
- @Input() formPlaceholderText = "Search for research results, projects, content providers & organizations in OpenAIRE";
+ @Input() formPlaceholderText = "Search for research outcomes, projects, content providers & organizations in OpenAIRE";
public subPub;
diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts
index b9636409..801bdb9f 100644
--- a/searchPages/searchUtils/newSearchPage.component.ts
+++ b/searchPages/searchUtils/newSearchPage.component.ts
@@ -975,7 +975,7 @@ export class NewSearchPageComponent {
// selectedToValue = value.substring(10, 14);
// }
- if(this.rangeFields[i][0] == this.rangeFields[i][1]) {
+ /*if(this.rangeFields[i][0] == this.rangeFields[i][1]) {
//console.log(selectedFromValue + " - "+selectedToValue);
if (selectedFromValue && selectedToValue) {
let equalityOp = this.fieldIdsMap[filterId].equalityOperator;
@@ -1011,7 +1011,8 @@ export class NewSearchPageComponent {
if(selectedFromValue || selectedToValue) {
fq = "&fq=" + StringUtils.URIEncode(fq);
}
- }
+ }*/
+ fq = NewSearchPageComponent.createRangeFilterQuery(this.rangeFields[i], selectedFromValue, selectedToValue, this.fieldIdsMap[filterId].equalityOperator, this.fieldIdsMap[this.rangeFields[i][0]].equalityOperator, this.fieldIdsMap[this.rangeFields[i][1]].equalityOperator, filterOp );
}
}
}
@@ -1022,7 +1023,44 @@ export class NewSearchPageComponent {
return allFqs;
}
+ // createRangeFilterQuery(this.rangeFields[i], selectedFromValue, selectedToValue, this.fieldIdsMap[this.rangeFields[i][0]].equalityOperator, this.fieldIdsMap[this.rangeFields[i][1]].equalityOperator; filterOp )
+public static createRangeFilterQuery(rangeField,selectedFromValue, selectedToValue, equalityOp, equalityOpFrom, equalityOpTo, filterOp ){
+ let fq="";
+ if(rangeField[0] == rangeField[1]) {
+ //console.log(selectedFromValue + " - "+selectedToValue);
+ if (selectedFromValue && selectedToValue) {
+ fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[0] + equalityOp + "\"" + selectedFromValue + " " + selectedToValue + "\"";
+ fq = "&fq=" + StringUtils.URIEncode(fq);
+ } else if (selectedFromValue) {
+ if(equalityOpFrom == " = ") {
+ equalityOpFrom = " >= ";
+ }
+ fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[0] + equalityOpFrom + "\"" + selectedFromValue + "\"";
+ fq = "&fq=" + StringUtils.URIEncode(fq);
+ } else if (selectedToValue) {
+ if(equalityOpTo == " = ") {
+ equalityOpTo = " <= ";
+ }
+ fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[0] + equalityOpTo + "\"" + selectedToValue + "\"";
+ fq = "&fq=" + StringUtils.URIEncode(fq);
+ }
+ } else {
+ if (selectedFromValue) {
+ fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[0] + equalityOpFrom + "\"" + selectedFromValue + "\"";
+ // fq = "&fq=" + StringUtils.URIEncode(fq);
+ }
+ if (selectedToValue) {
+ fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[1] + equalityOpTo + "\"" + selectedToValue + "\"";
+ // fq = "&fq=" + StringUtils.URIEncode(fq);
+ }
+ if(selectedFromValue || selectedToValue) {
+ fq = "&fq=" + StringUtils.URIEncode(fq);
+ }
+
+ }
+ return fq;
+}
/**
* Sets parameterNames and parameterValues arrays
* used in paging, advanced search link, Goto()
diff --git a/sharedComponents/other-portals/other-portals.component.html b/sharedComponents/other-portals/other-portals.component.html
index 75f60f2f..5eea5298 100644
--- a/sharedComponents/other-portals/other-portals.component.html
+++ b/sharedComponents/other-portals/other-portals.component.html
@@ -5,7 +5,7 @@
Researcher?
- Explore all OA research results. Link all your research. Build your profile
+ Explore all OA research outcomes. Link all your research. Build your profile
@@ -51,7 +51,7 @@
Research manager?
- Use our monitoring services and easily track all relevant research results.
+ Use our monitoring services and easily track all relevant research outcomes.
diff --git a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts
index 35c9f067..97fa5bc7 100644
--- a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts
+++ b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts
@@ -128,9 +128,9 @@ convertDatasource(datasource: any, URL, otherUrl): Organization {
private getTitle(result: any): String[] {
const title = _.get(result, "result.metadata.oaf:entity.oaf:result.title", null);
if(title && Array.isArray(title) ){
- return title[0].content;
+ return (title[0] && title[0].content)?title[0].content:"";
}else{
- return title.content;
+ return (title && title.content)?title.content:"";
}
}
diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts
index 477d2f11..b3948d3a 100644
--- a/utils/properties/searchFields.ts
+++ b/utils/properties/searchFields.ts
@@ -45,7 +45,8 @@ export class SearchFields {
["resultbestaccessright"]:{name:"Access Mode", type:"vocabulary", param:"access", operator: "ac", equalityOperator: " exact ", filterType: "radio"},
["collectedfrom"]:{name:"Collected From", type:"refine", param:"datasource", operator: "cl", equalityOperator: " exact ", filterType: "checkbox"},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", operator: "og", equalityOperator: " exact ", filterType: null},
- ["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", operator: "cl", equalityOperator: " exact ", filterType: null}
+ ["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", operator: "cl", equalityOperator: " exact ", filterType: null},
+ ["resulttypeid"]:{name:"Result type", type:"refine", param:"types", operator: "tp", equalityOperator: " exact ", filterType: "radio"}
};
//PROJECT
@@ -70,7 +71,7 @@ export class SearchFields {
["fundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", operator: "fn2", equalityOperator: " exact ", filterType: "checkbox"},
["projectstartyear"]:{name:"Start Year", type:"year", param:"startyear", operator: "sy", equalityOperator: " <= ", filterType: "checkbox"},
["projectendyear"]:{name:"End Year", type:"year", param:"endyear", operator: "ey", equalityOperator: " >= ", filterType: "checkbox"},
- ["projectendyear-range-projectstartyear"]:{name:"Year range", type:"year", param:"year", operator: "ya", equalityOperator: " = ", filterType: "range"},
+ ["projectendyear-range-projectstartyear"]:{name:"Active within", type:"year", param:"year", operator: "ya", equalityOperator: " = ", filterType: "range"},
["projectstartdate"]:{name:"Start Date", type:"date", param:"startdate", operator: "sd", equalityOperator: " within ", filterType: null},
["projectenddate"]:{name:"End Date", type:"date", param:"enddate", operator: "ed", equalityOperator: " within ", filterType: null},
["projectecsc39"]:{name:"Special Clause 39", type:"boolean", param:"sc39", operator: "sc", equalityOperator: " exact ", filterType: "radio"},
diff --git a/utils/rangeFilter/rangeFilter.component.html b/utils/rangeFilter/rangeFilter.component.html
index dadf7b2a..ed085927 100644
--- a/utils/rangeFilter/rangeFilter.component.html
+++ b/utils/rangeFilter/rangeFilter.component.html
@@ -10,10 +10,12 @@