Skip to content

Commit

Permalink
fix indexing of country iso code #EA-3721
Browse files Browse the repository at this point in the history
  • Loading branch information
GordeaS authored and GordeaS committed Apr 23, 2024
1 parent ddd18ce commit 93d7e64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ void addToCountryMappings(List<ZohoLabelUriMapping> countryMappingList) {

void addToCountryIdMappings(List<ZohoLabelUriMapping> countryMappingList) {
for (ZohoLabelUriMapping countryMapping : countryMappingList) {
//init entityID - to ZohoCountry mapping
countryIdMappings.put(countryMapping.getZohoLabel(), countryMapping);
//init entityID - to ZohoCountry mapping
if(countryMapping.getEntityUri() != null) {
countryIdMappings.put(countryMapping.getEntityUri(), countryMapping);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ public SolrOrganization(Organization organization) {

this.country=new ArrayList<>();
String orgCountryId=organization.getCountryId();
String orgCoutryISO=organization.getCountryISO();
String orgCountryISO=organization.getCountryISO();
if(orgCountryId!=null) {
this.country.add(orgCountryId);
}
if(orgCoutryISO!=null) {
this.country.add(orgCoutryISO);
if(orgCountryISO!=null) {
this.country.add(orgCountryISO);
}
if(organization.getCountry() != null) {
this.setCountryLabel(organization.getCountry().getPrefLabel());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void dereferenceLinkedEntities(Organization org) {
new String[] {EntityRecordFields.ENTITY});
setDereferencedCountry(org, countryRecord);

ZohoLabelUriMapping mapping = emConfiguration.getCountryIdMappings().get(org.getEntityId());
ZohoLabelUriMapping mapping = emConfiguration.getCountryIdMappings().get(org.getCountryId());
if(mapping != null) {
//extract ISO code from ZohoCountry
org.setCountryISO(mapping.getCountryISOCode());
Expand Down

0 comments on commit 93d7e64

Please sign in to comment.