Clean up utils/properties/searchFields.ts

Add operator for each parameter
change the way operators were produced: use 1st and 3rd letter if the operator is unique
Change the operator parameter in all pages that have links to advanced search



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52676 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2018-07-05 10:52:42 +00:00
parent 618b00dcc3
commit f3c0682eb2
11 changed files with 104 additions and 107 deletions

View File

@ -72,7 +72,7 @@ import {PiwikService} from '../utils/piwik/piwik.service';
</span>
</a-->
<a [queryParams]="routerHelper.createQueryParams(['organizationId', 'or'], [organizationId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['organizationId', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders" class="uk-button uk-button-text">
View all {{fetchDataproviders.searchUtils.totalResults | number}} results
</a>

View File

@ -263,10 +263,10 @@ export class DataProviderComponent {
}
if(this.dataProviderInfo.resultsBy == "collectedFrom") {
//this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'co'], [this.datasourceId, 'and']);
this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl'], [this.datasourceId, 'and']);
} else if (this.dataProviderInfo.resultsBy == "hostedBy") {
//this.paramsForSearchLink = "?hostedBy="+this.datasourceId+"&ho=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'ho'], [this.datasourceId, 'and']);
this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs'], [this.datasourceId, 'and']);
}
}

View File

@ -43,7 +43,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
</a>
</td>
<td *ngIf="fetchPublications.results.length > 0" class="uk-text-center">
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'ho', 'collectedFrom', 'co'], [id, 'and', dataproviderId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'hs', 'collectedFrom', 'cl'], [id, 'and', dataproviderId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications">
{{results.get(id).countPublications | number}}
</a>
@ -51,7 +51,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
<td *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>
<td *ngIf="fetchDatasets.results.length > 0" class="uk-text-center">
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'ho', 'collectedFrom', 'co'], [id, 'and', dataproviderId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'hs', 'collectedFrom', 'cl'], [id, 'and', dataproviderId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchResearchData">
{{results.get(id).countDatasets | number}}
</a>

View File

@ -86,10 +86,10 @@ export class JsonldDocumentSerializerService {
}
if (doc.keyword && doc.keyword.length == 1) {
buffer["keyword"] = doc.keyword[0];
buffer["keywords"] = doc.keyword[0];
}
else if (doc.keyword && doc.keyword.length > 1) {
buffer["keyword"] = _.join(doc.keyword, ", ");
buffer["keywords"] = _.join(doc.keyword, ", ");
}
if (doc.citation && doc.citation.length == 1) {

View File

@ -16,7 +16,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResultsNoFilters > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'or'], [organizationId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchProjects" class="uk-button uk-button-text">
View all {{fetchProjects.searchUtils.totalResultsNoFilters | number}} results
</a>

View File

@ -9,7 +9,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<a (click)="showAll = !showAll;">View less authors</a>
</div>
<span *ngFor="let author of authors.slice(0,30) let i=index" style="font-style: italic;">
<!--a [queryParams]="routerHelper.createQueryParams(['author','au'],[quote(author['name']),'and'])" routerLinkActive="router-link-active" [routerLink]="'/search/advanced/'+searchPage">
<!--a [queryParams]="routerHelper.createQueryParams(['author','at'],[quote(author['name']),'and'])" routerLinkActive="router-link-active" [routerLink]="'/search/advanced/'+searchPage">
{{author['name']}}
</a-->
{{author}}
@ -18,7 +18,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<span *ngIf="!showAll && authors.length > 30"> ... </span>
<span *ngIf="showAll" style="font-style: italic;">
<span *ngFor="let author of authors.slice(30) let i=index">
<!--a [queryParams]="routerHelper.createQueryParams(['author','au'],[quote(author['name']),'and'])" routerLinkActive="router-link-active" [routerLink]="'/search/advanced/'+searchPage">
<!--a [queryParams]="routerHelper.createQueryParams(['author','at'],[quote(author['name']),'and'])" routerLinkActive="router-link-active" [routerLink]="'/search/advanced/'+searchPage">
{{author['name']}}
</a-->
{{author}}

View File

@ -28,7 +28,7 @@
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'or'], [organizationId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results
</a>
@ -66,7 +66,7 @@
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'or'], [organizationId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders" class="uk-button uk-button-text">
View all {{fetchDataproviders.searchUtils.totalResults | number}} results
</a>
@ -152,7 +152,7 @@
<div *ngIf="fetchPublications.searchUtils.totalResults > 0">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'or'], [organizationId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results
</a>
@ -173,7 +173,7 @@
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'or'], [organizationId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders" class="uk-button uk-button-text">
View all {{fetchDataproviders.searchUtils.totalResults | number}} results
</a>

View File

@ -92,7 +92,7 @@
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" >
<a [queryParams]="routerHelper.createQueryParams(['project', 'pr'], [projectId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results
</a>
@ -118,7 +118,7 @@
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'pr'], [projectId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text">
View all {{fetchDatasets.searchUtils.totalResults | number}} results
</a>
@ -144,7 +144,7 @@
<div *ngIf="fetchSoftware.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchSoftware.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'pr'], [projectId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware" class="uk-button uk-button-text">
View all {{fetchSoftware.searchUtils.totalResults | number}} results
</a>
@ -292,7 +292,7 @@
<div *ngIf="fetchPublications.searchUtils.totalResults > 0">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" >
<a [queryParams]="routerHelper.createQueryParams(['project', 'pr'], [projectId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results
</a>
@ -310,7 +310,7 @@
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'pr'], [projectId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text">
View all {{fetchDatasets.searchUtils.totalResults | number}} results
</a>
@ -327,7 +327,7 @@
<div *ngIf="fetchSoftware.searchUtils.totalResults > 0">
<div class = "uk-text-right" *ngIf = "fetchSoftware.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'pr'], [projectId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware" class="uk-button uk-button-text">
View all {{fetchSoftware.searchUtils.totalResults | number}} results
</a>

View File

@ -188,10 +188,10 @@ export class AdvancedSearchPageComponent {
if(fields[this.fieldIds[i]]){
params+="&"+this.fieldIdsMap[this.fieldIds[i]].param+"="+fields[this.fieldIds[i]].values.join()+
"&"+this.getOperatorParameter(this.fieldIdsMap[this.fieldIds[i]].param)+"="+fields[this.fieldIds[i]].operators.join()
"&"+ this.fieldIdsMap[this.fieldIds[i]].operator+"="+fields[this.fieldIds[i]].operators.join()
this.parameterNames.push(this.fieldIdsMap[this.fieldIds[i]].param);
this.parameterValues.push(fields[this.fieldIds[i]].values.join());
this.parameterNames.push(this.getOperatorParameter(this.fieldIdsMap[this.fieldIds[i]].param));
this.parameterNames.push( this.fieldIdsMap[this.fieldIds[i]].operator);
this.parameterValues.push(fields[this.fieldIds[i]].operators.join());
}
}
@ -271,12 +271,10 @@ export class AdvancedSearchPageComponent {
this.baseURLWithParameters = this.searchUtils.baseUrl + this.createUrlParameters(false);
}
getOperatorParameter(parameter:string):string{
if(parameter.length > 2){
return parameter.substring(0,2);
}else if(parameter == "q"){
return "op";
}else{
return parameter+"Op";
for (let id of this.fieldIds) {
if(this.fieldIdsMap[id]["param"] == parameter){
return this.fieldIdsMap[id]["operator"];
}
}
}
// for loading

View File

@ -34,7 +34,7 @@
<span *ngIf="result['authors'] != undefined" class="resultsAuthors uk-margin-small-top" style="font-style: italic;">
<span *ngFor="let author of result['authors'].slice(0,15)">
<!--a href="{{author['url']}}"-->
<!--a [queryParams]="routerHelper.createQueryParams(['author','au'],[quote(author['name']),'and'])" routerLinkActive="router-link-active" [routerLink]="linkToAdvancedSearchPage">
<!--a [queryParams]="routerHelper.createQueryParams(['author','at'],[quote(author['name']),'and'])" routerLinkActive="router-link-active" [routerLink]="linkToAdvancedSearchPage">
{{author['name']}};
</a-->
{{author}};

View File

@ -1,44 +1,43 @@
export class SearchFields {
//main Entities
//RESULTS
//Used for datasets and publications
//In case Datasets should display different fields, use seperate tables for fields
//Used for datasets and publications and software
//In case Datasets or Software should display different fields, use seperate tables for fields
public RESULT_REFINE_FIELDS = [
"relfunder",
"relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id",
"relproject","resultacceptanceyear",
"resultbestaccessright", "instancetypename", "resultlanguagename", "community","resulthostingdatasource"];
public RESULT_ADVANCED_FIELDS:string[] = ["q","resulttitle","resultauthor","resultpublisher","instancetypename",
"resultlanguagename", "community","relprojectid", "relfunder",
public RESULT_ADVANCED_FIELDS:string[] = ["q","resulttitle","resultauthor","resultpublisher",
"resultbestaccessright","community","collectedfromdatasourceid","resulthostingdatasourceid", "resultdateofacceptance",
"relfunder",
"relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id",
"resultdateofacceptance","resultbestaccessright","pid","resulthostingdatasourceid","collectedfromdatasourceid", "relorganizationid"];
"resultlanguagename", "relorganizationid", "pid","relprojectid", "instancetypename"];
public RESULT_FIELDS: { [key:string]:FieldDetails}={
["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="},
["resulttitle"]:{name:"Title", type:"keyword", param:"title", equalityOperator: "="},
["resultauthor"]:{name:"Author", type:"keyword", param:"author", equalityOperator: "="},
["resultpublisher"]:{name:"Publisher", type:"keyword", param:"publisher", equalityOperator: "="},
["pid"]:{name:"PID", type:"keyword", param:"pid", equalityOperator: " = "},
["resulthostingdatasourceid"]:{name:"Hosting Content Provider", type:"entity", param:"hostedBy", equalityOperator: " exact "},
["resulthostingdatasource"]:{name:"Content Provider", type:"refine", param:"hostedBy", equalityOperator: " exact "},
["instancetypename"]:{name:"Type", type:"vocabulary", param:"type", equalityOperator: " exact "},
// ["instancetypenameid"]:{name:"Type", type:"vocabulary", param:"type", equalityOperator: " exact "},
["resultlanguagename"]:{name:"Language", type:"vocabulary", param:"lang", equalityOperator: " exact "},
// ["resultlanguageid"]:{name:"Language", type:"vocabulary", param:"lang", equalityOperator: " exact "},
["community"]:{name:"Community", type:"refine", param:"community", equalityOperator: " exact "},
["relproject"]:{name:"Project", type:"refine", param:"project", equalityOperator: " exact "},
["relprojectid"]:{name:"Project", type:"entity", param:"project", equalityOperator: " exact "},
["relfunder"]:{name:"Funder", type:"refine", param:"funder", equalityOperator: " exact "},
["relfundinglevel0_id"]:{name:"Funding Stream", type:"refine", param:"funderlv0", equalityOperator: " exact "},
["relfundinglevel1_id"]:{name:"Funding Substream level 1", type:"refine", param:"funderlv1", equalityOperator: " exact "},
["relfundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", equalityOperator: " exact "},
["resultacceptanceyear"]:{name:"Publication Date", type:"keyword", param:"year", equalityOperator: " exact "},
["resultdateofacceptance"]:{name:"Publication Date", type:"date", param:"date", equalityOperator: " within "},
["resultbestaccessright"]:{name:"Access Mode", type:"vocabulary", param:"access", equalityOperator: " exact "},
// ["resultbestaccessright"]:{name:"Access Mode", type:"refine", param:"access", equalityOperator: " exact "},
["collectedfrom"]:{name:"Content Provider", type:"refine", param:"datasource", equalityOperator: " exact "},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", equalityOperator: " exact "},
["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", equalityOperator: " exact "}
["q"]:{name:"All fields", type:"keyword", param:"q", operator: "op", equalityOperator: "="},
["resulttitle"]:{name:"Title", type:"keyword", param:"title", operator: "tt", equalityOperator: "="},
["resultauthor"]:{name:"Author", type:"keyword", param:"author", operator: "at", equalityOperator: "="},
["resultpublisher"]:{name:"Publisher", type:"keyword", param:"publisher", operator: "pb", equalityOperator: "="},
["pid"]:{name:"PID", type:"keyword", param:"pid", operator: "pd", equalityOperator: " = "},
["resulthostingdatasourceid"]:{name:"Hosting Content Provider", type:"entity", param:"hostedBy", operator: "hs", equalityOperator: " exact "},
["resulthostingdatasource"]:{name:"Content Provider", type:"refine", param:"hostedBy", operator: "hs", equalityOperator: " exact "},
["instancetypename"]:{name:"Type", type:"vocabulary", param:"type", operator: "tp", equalityOperator: " exact "},
["resultlanguagename"]:{name:"Language", type:"vocabulary", param:"lang", operator: "ln", equalityOperator: " exact "},
["community"]:{name:"Community", type:"refine", param:"community", operator: "cm", equalityOperator: " exact "},
["relproject"]:{name:"Project", type:"refine", param:"project", operator: "po", equalityOperator: " exact "},
["relprojectid"]:{name:"Project", type:"entity", param:"project", operator: "po", equalityOperator: " exact "},
["relfunder"]:{name:"Funder", type:"refine", param:"funder", operator: "fn", equalityOperator: " exact "},
["relfundinglevel0_id"]:{name:"Funding Stream", type:"refine", param:"funderlv0", operator: "fn0", equalityOperator: " exact "},
["relfundinglevel1_id"]:{name:"Funding Substream level 1", type:"refine", param:"funderlv1", operator: "fn1", equalityOperator: " exact "},
["relfundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", operator: "fn0", equalityOperator: " exact "},
["resultacceptanceyear"]:{name:"Publication Date", type:"keyword", param:"year", operator: "ya", equalityOperator: " exact "},
["resultdateofacceptance"]:{name:"Publication Date", type:"date", param:"date", operator: "dt", equalityOperator: " within "},
["resultbestaccessright"]:{name:"Access Mode", type:"vocabulary", param:"access", operator: "ac", equalityOperator: " exact "},
["collectedfrom"]:{name:"Content Provider", type:"refine", param:"datasource", operator: "dt", equalityOperator: " exact "},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", operator: "og", equalityOperator: " exact "},
["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", operator: "cl", equalityOperator: " exact "}
};
//PROJECT
@ -50,23 +49,23 @@ export class SearchFields {
"projectstartdate","projectenddate","projectecsc39",
"projectcode_nt","relorganizationid", "collectedfromdatasourceid"];
public PROJECT_FIELDS: { [key:string]:FieldDetails}={
["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="},
["projectacronym"]:{name:"Acronym", type:"keyword", param:"acronym", equalityOperator: "="},
["projecttitle"]:{name:"Title", type:"keyword", param:"title", equalityOperator: "="},
["projectkeywords"]:{name:"Keywords", type:"keyword", param:"keywords", equalityOperator: "="},
["q"]:{name:"All fields", type:"keyword", param:"q", operator: "op", equalityOperator: "="},
["projectacronym"]:{name:"Acronym", type:"keyword", param:"acronym", operator: "ar", equalityOperator: "="},
["projecttitle"]:{name:"Title", type:"keyword", param:"title", operator: "tt", equalityOperator: "="},
["projectkeywords"]:{name:"Keywords", type:"keyword", param:"keywords", operator: "ky", equalityOperator: "="},
["funder"]:{name:"Funder", type:"refine", param:"funder", equalityOperator: " exact "},
["fundinglevel0_id"]:{name:"Funding Stream", type:"refine", param:"funderlv0", equalityOperator: " exact "},
["fundinglevel1_id"]:{name:"Funding Substream level 1", type:"refine", param:"funderlv1", equalityOperator: " exact "},
["fundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", equalityOperator: " exact "},
["projectstartyear"]:{name:"Start Year", type:"year", param:"startyear", equalityOperator: " exact "},
["projectendyear"]:{name:"End Year", type:"year", param:"endyear", equalityOperator: " exact "},
["projectstartdate"]:{name:"Start Date", type:"date", param:"startdate", equalityOperator: " within "},
["projectenddate"]:{name:"End Date", type:"date", param:"enddate", equalityOperator: " within "},
["projectecsc39"]:{name:"Special Clause 39", type:"boolean", param:"sc39", equalityOperator: " exact "},
["projectcode_nt"]:{name:"Project Code", type:"keyword", param:"code", equalityOperator: " exact "},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", equalityOperator: " exact "},
["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", equalityOperator: " exact "}
["funder"]:{name:"Funder", type:"refine", param:"funder", operator: "fn", equalityOperator: " exact "},
["fundinglevel0_id"]:{name:"Funding Stream", type:"refine", param:"funderlv0", operator: "fn0", equalityOperator: " exact "},
["fundinglevel1_id"]:{name:"Funding Substream level 1", type:"refine", param:"funderlv1", operator: "fn1", equalityOperator: " exact "},
["fundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", operator: "fn2", equalityOperator: " exact "},
["projectstartyear"]:{name:"Start Year", type:"year", param:"startyear", operator: "sy", equalityOperator: " exact "},
["projectendyear"]:{name:"End Year", type:"year", param:"endyear", operator: "ey", equalityOperator: " exact "},
["projectstartdate"]:{name:"Start Date", type:"date", param:"startdate", operator: "sd", equalityOperator: " within "},
["projectenddate"]:{name:"End Date", type:"date", param:"enddate", operator: "ed", equalityOperator: " within "},
["projectecsc39"]:{name:"Special Clause 39", type:"boolean", param:"sc39", operator: "sc", equalityOperator: " exact "},
["projectcode_nt"]:{name:"Project Code", type:"keyword", param:"code", operator: "cd", equalityOperator: " exact "},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", operator: "og", equalityOperator: " exact "},
["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", operator: "cl", equalityOperator: " exact "}
};
@ -79,19 +78,19 @@ export class SearchFields {
"datasourceodcontenttypes", "datasourcecompatibilityname","relorganizationid", "collectedfromdatasourceid"];
public DATASOURCE_FIELDS: { [key:string]:FieldDetails}={
["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="},
["datasourceofficialname"]:{name:"English name", type:"keyword", param:"officialname", equalityOperator: "="},
["datasourceenglishname"]:{name:"Title", type:"keyword", param:"engname", equalityOperator: "="},
["datasourceodsubjects"]:{name:"Subject", type:"keyword", param:"subjects", equalityOperator: "="},
["datasourcetypeuiid"]:{name:"Type", type:"refine", param:"type", equalityOperator: " exact "},
["datasourcetypeuiname"]:{name:"Type", type:"refine", param:"type", equalityOperator: " exact "},
["datasourcetypename"]:{name:"Type", type:"vocabulary", param:"type", equalityOperator: " exact "},
["datasourceodlanguages"]:{name:"Language", type:"vocabulary", param:"lang", equalityOperator: " exact "},
["datasourceodcontenttypes"]:{name:"Content", type:"refine", param:"content", equalityOperator: " exact "},
["datasourcecompatibilityid"]:{name:"Compatibility Level", type:"refine", param:"compatibility", equalityOperator: " exact "},
["datasourcecompatibilityname"]:{name:"Compatibility Level", type:"vocabulary", param:"compatibility", equalityOperator: " exact "},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", equalityOperator: " exact "},
["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", equalityOperator: " exact "}
["q"]:{name:"All fields", type:"keyword", param:"q", operator: "op", equalityOperator: "="},
["datasourceofficialname"]:{name:"English name", type:"keyword", param:"officialname", operator: "of", equalityOperator: "="},
["datasourceenglishname"]:{name:"Title", type:"keyword", param:"engname", operator: "eg", equalityOperator: "="},
["datasourceodsubjects"]:{name:"Subject", type:"keyword", param:"subjects", operator: "sb", equalityOperator: "="},
["datasourcetypeuiid"]:{name:"Type", type:"refine", param:"type", operator: "tp", equalityOperator: " exact "},
["datasourcetypeuiname"]:{name:"Type", type:"refine", param:"type", operator: "tp", equalityOperator: " exact "},
["datasourcetypename"]:{name:"Type", type:"vocabulary", param:"type", operator: "tp", equalityOperator: " exact "},
["datasourceodlanguages"]:{name:"Language", type:"vocabulary", param:"lang", operator: "ln", equalityOperator: " exact "},
["datasourceodcontenttypes"]:{name:"Content", type:"refine", param:"content", operator: "cn", equalityOperator: " exact "},
["datasourcecompatibilityid"]:{name:"Compatibility Level", type:"refine", param:"compatibility", operator: "cm", equalityOperator: " exact "},
["datasourcecompatibilityname"]:{name:"Compatibility Level", type:"vocabulary", param:"compatibility", operator: "cm", equalityOperator: " exact "},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", operator: "og", equalityOperator: " exact "},
["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", operator: "cl", equalityOperator: " exact "}
};
public COMPATIBLE_DATAPROVIDER_FIELDS:string[] = ["datasourcetypeuiid","datasourcecompatibilityname"];
@ -104,24 +103,23 @@ export class SearchFields {
public ORGANIZATION_ADVANCED_FIELDS:string[] = ["q", "organizationlegalname","organizationlegalshortname","organizationcountryname"];
public ORGANIZATION_FIELDS: { [key:string]:FieldDetails}={
["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="},
["organizationlegalname"]:{name:"Legal Name", type:"keyword", param:"name", equalityOperator: "="},
["organizationlegalshortname"]:{name:"Legal Short Name", type:"keyword", param:"shortname", equalityOperator: "="},
["organizationcountryname"]:{name:"Country", type:"vocabulary", param:"country", equalityOperator: "="},
// ["organizationcountryname"]:{name:"Country", type:"refine", param:"country", equalityOperator: "="}
["q"]:{name:"All fields", type:"keyword", param:"q", operator:"op", equalityOperator: "="},
["organizationlegalname"]:{name:"Legal Name", type:"keyword", param:"name", operator: "nm", equalityOperator: "="},
["organizationlegalshortname"]:{name:"Legal Short Name", type:"keyword", param:"shortname", operator: "so", equalityOperator: "="},
["organizationcountryname"]:{name:"Country", type:"vocabulary", param:"country", operator: "cu", equalityOperator: "="},
};
public ORGANIZATION_INDEX:string[] = ["organizationcountryname"]//,"organizationeclegalbody"];
public ADVANCED_SEARCH_ORGANIZATION_PARAM:string[] = ["q","contenttype","compatibility","country","type"];
public ORGANIZATION_INDEX_PARAM_MAP:{ [key:string]:string } = {["organizationlegalname"]:"contenttype", ["organizationlegalshortname"]:"type",
["organizationcountryname"]:"country"};//,["organizationeclegalbody"]:"type"};
public ORGANIZATION_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string , equalityOperator:string}} ={
["q"]:{name:"All fields",operator:"op", type:"keyword", indexField:null, equalityOperator: "="},
["contenttype"]:{name:"Legal Name",operator:"cn", type:"keyword" , indexField:"organizationlegalname", equalityOperator: "="},
["compatibility"]:{name:"Legal Short Name",operator:"cm", type:"keyword", indexField:"organizationlegalshortname", equalityOperator: "="},
["country"]:{name:"Country",operator:"cu", type:"vocabulary", indexField:"organizationcountryname", equalityOperator: " exact "},
["type"]:{name:"Type",operator:"tp", type:"refine", indexField:"organizationeclegalbody", equalityOperator: " exact "},
};
// public ORGANIZATION_INDEX:string[] = ["organizationcountryname"]//,"organizationeclegalbody"];
// public ADVANCED_SEARCH_ORGANIZATION_PARAM:string[] = ["q","contenttype","compatibility","country","type"];
// public ORGANIZATION_INDEX_PARAM_MAP:{ [key:string]:string } = {["organizationlegalname"]:"contenttype", ["organizationlegalshortname"]:"type",
// ["organizationcountryname"]:"country"};//,["organizationeclegalbody"]:"type"};
// public ORGANIZATION_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string , operator: "op", equalityOperator:string}} ={
// ["q"]:{name:"All fields",operator:"op", type:"keyword", indexField:null, operator: "op", equalityOperator: "="},
// ["contenttype"]:{name:"Legal Name",operator:"cn", type:"keyword" , indexField:"organizationlegalname", operator: "op", equalityOperator: "="},
// ["compatibility"]:{name:"Legal Short Name",operator:"cm", type:"keyword", indexField:"organizationlegalshortname", operator: "op", equalityOperator: "="},
// ["country"]:{name:"Country",operator:"cu", type:"vocabulary", indexField:"organizationcountryname", operator: "op", equalityOperator: " exact "},
// ["type"]:{name:"Type",operator:"tp", type:"refine", indexField:"organizationeclegalbody", operator: "op", equalityOperator: " exact "},
//
// };
@ -156,4 +154,5 @@ export class FieldDetails{
type:string;
param:string;
equalityOperator:string;
operator:string;
}