diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts index 23b69235..d5ec5eb4 100644 --- a/utils/properties/searchFields.ts +++ b/utils/properties/searchFields.ts @@ -102,14 +102,14 @@ export class SearchFields { //ORGANIZATION - public ORGANIZATION_REFINE_FIELDS:string[] = ["organizationcountryname"] - public ORGANIZATION_ADVANCED_FIELDS:string[] = ["q", "organizationlegalname","organizationlegalshortname","organizationcountryname"]; + public ORGANIZATION_REFINE_FIELDS:string[] = ["country"] + public ORGANIZATION_ADVANCED_FIELDS:string[] = ["q", "organizationlegalname","organizationlegalshortname","country"]; public ORGANIZATION_FIELDS: { [key:string]:FieldDetails}={ ["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: "="}, + ["country"]:{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"]; diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index 05fd6a96..84c917aa 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -82,16 +82,19 @@ export class ISVocabulariesService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) //.map(res => res.json()) .pipe(map(res => res['terms'])) - .pipe(map(res => this.parse(res))) + .pipe(map(res => this.parse(res, vocabularyName))) .pipe(catchError(this.handleError)); } - parse (data: any):AutoCompleteValue[] { + parse (data: any, vocabularyName: string):AutoCompleteValue[] { var array:AutoCompleteValue[] =[] for(var i = 0; i < data.length; i++){ var value:AutoCompleteValue = new AutoCompleteValue(); - value.id = data[i].englishName;//data[i].code; + value.id = data[i].englishName;//data[i].code; + if(vocabularyName == 'dnet:countries.json'){ //use Country code instead of country name + value.id = data[i].code; + } value.label = data[i].englishName; array.push(value); }