From d972a2a2f33498c1c40229c9d1ad47a953472062 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Fri, 6 Jun 2025 09:23:02 +0200 Subject: [PATCH] Add index storage optimized --- src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java | 9 +++++++++ .../fhir/jpa/starter/common/FhirServerConfigCommon.java | 1 + src/main/resources/application.yaml | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java index 7bb9a11..80c7b21 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java @@ -111,6 +111,7 @@ public class AppProperties { private Map remote_terminology_service = null; private Boolean match_url_cache_enabled = false; + private Boolean index_storage_optimized = false; public List getCustomInterceptorClasses() { return custom_interceptor_classes; @@ -753,6 +754,14 @@ public class AppProperties { match_url_cache_enabled = theMatchUrlCacheEnabled; } + public boolean getIndex_storage_optimized() { + return defaultIfNull(index_storage_optimized, false); + } + + public void setIndex_storage_optimized(boolean theIndex_storage_optimized) { + index_storage_optimized = theIndex_storage_optimized; + } + public static class Cors { private Boolean allow_Credentials = true; private List allowed_origin = List.of("*"); diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java b/src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java index 7e5a97e..4b79117 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java @@ -178,6 +178,7 @@ public class FhirServerConfigCommon { jpaStorageSettings.setAllowMultipleDelete(appProperties.getAllow_multiple_delete()); jpaStorageSettings.setAllowExternalReferences(appProperties.getAllow_external_references()); jpaStorageSettings.setSchedulingDisabled(!appProperties.getDao_scheduling_enabled()); + jpaStorageSettings.setIndexStorageOptimized(appProperties.getIndex_storage_optimized()); jpaStorageSettings.setMatchUrlCacheEnabled(appProperties.getMatch_url_cache_enabled()); jpaStorageSettings.setDeleteEnabled(appProperties.getDelete_enabled()); jpaStorageSettings.setDeleteExpungeEnabled(appProperties.getDelete_expunge_enabled()); diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 990721b..240ed29 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -194,6 +194,8 @@ hapi: # delete_expunge_enabled: true # match_url_cache_enabled: false # enable_repository_validating_interceptor: true + ### Reduce the size used by search indexes by not tagging every row with the resource type and parameter name (this setting makes manual inspection of the database more difficult, but does not impact HAPI FHIR functionality in any way) + # index_storage_optimized: false # enable_index_missing_fields: false # enable_index_of_type: true # enable_index_contained_resource: false