Add configuration flag to enable storing of resources in lucene index (#304)
* Add configuration flag to enable storing of resources in lucene index * Fix build issue * Fix code review suggestions Co-authored-by: Jaison B <jaison.baskaran@smilecdr.com>
This commit is contained in:
@@ -66,6 +66,7 @@ public class AppProperties {
|
||||
private Map<String, ImplementationGuide> implementationGuides = null;
|
||||
|
||||
private Boolean lastn_enabled = false;
|
||||
private boolean store_resource_in_lucene_index_enabled = false;
|
||||
private NormalizedQuantitySearchLevel normalized_quantity_search_level = NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED;
|
||||
|
||||
private Integer search_coord_core_pool_size = 20;
|
||||
@@ -469,7 +470,15 @@ public class AppProperties {
|
||||
this.lastn_enabled = lastn_enabled;
|
||||
}
|
||||
|
||||
public NormalizedQuantitySearchLevel getNormalized_quantity_search_level() {
|
||||
public boolean getStore_resource_in_lucene_index_enabled() {
|
||||
return store_resource_in_lucene_index_enabled;
|
||||
}
|
||||
|
||||
public void setStore_resource_in_lucene_index_enabled(Boolean store_resource_in_lucene_index_enabled) {
|
||||
this.store_resource_in_lucene_index_enabled = store_resource_in_lucene_index_enabled;
|
||||
}
|
||||
|
||||
public NormalizedQuantitySearchLevel getNormalized_quantity_search_level() {
|
||||
return this.normalized_quantity_search_level;
|
||||
}
|
||||
|
||||
|
||||
@@ -407,8 +407,8 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
||||
daoConfig.setLastNEnabled(true);
|
||||
}
|
||||
|
||||
daoConfig.setStoreResourceInLuceneIndex(appProperties.getStore_resource_in_lucene_index_enabled());
|
||||
daoConfig.getModelConfig().setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level());
|
||||
|
||||
daoConfig.getModelConfig().setIndexOnContainedResources(appProperties.getEnable_index_contained_resource());
|
||||
daoConfig.getModelConfig().setIndexOnContainedResources(appProperties.getEnable_index_contained_resource());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHan
|
||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
|
||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||
import ca.uhn.fhir.rest.server.mail.MailConfig;
|
||||
import ca.uhn.fhir.rest.server.mail.MailSvc;
|
||||
import com.google.common.base.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hl7.fhir.dstu2.model.Subscription;
|
||||
@@ -69,7 +70,7 @@ public class FhirServerConfigCommon {
|
||||
if (appProperties.getSubscription().getEmail() != null) {
|
||||
ourLog.info("Email subscriptions enabled");
|
||||
}
|
||||
|
||||
|
||||
if (appProperties.getEnable_index_contained_resource() == Boolean.TRUE) {
|
||||
ourLog.info("Indexed on contained resource enabled");
|
||||
}
|
||||
@@ -145,7 +146,7 @@ public class FhirServerConfigCommon {
|
||||
if(appProperties.getPartitioning().getAllow_references_across_partitions()) {
|
||||
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.ALLOWED_UNQUALIFIED);
|
||||
} else {
|
||||
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.NOT_ALLOWED);
|
||||
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.NOT_ALLOWED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +179,7 @@ public class FhirServerConfigCommon {
|
||||
}
|
||||
|
||||
modelConfig.setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level());
|
||||
|
||||
|
||||
modelConfig.setIndexOnContainedResources(appProperties.getEnable_index_contained_resource());
|
||||
return modelConfig;
|
||||
}
|
||||
@@ -225,10 +226,9 @@ public class FhirServerConfigCommon {
|
||||
mailConfig.setSmtpPassword(email.getPassword());
|
||||
mailConfig.setSmtpUseStartTLS(email.getStartTlsEnable());
|
||||
|
||||
IEmailSender emailSender = new EmailSenderImpl(mailConfig);
|
||||
IEmailSender emailSender = new EmailSenderImpl(new MailSvc(mailConfig));
|
||||
|
||||
if(subscriptionDeliveryHandlerFactory.isPresent())
|
||||
subscriptionDeliveryHandlerFactory.get().setEmailSender(emailSender);
|
||||
subscriptionDeliveryHandlerFactory.ifPresent(theSubscriptionDeliveryHandlerFactory -> theSubscriptionDeliveryHandlerFactory.setEmailSender(emailSender));
|
||||
|
||||
return emailSender;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user