From 28d4f65d7943afb12c765f86c259565db9b5fc2b Mon Sep 17 00:00:00 2001 From: James Agnew Date: Tue, 10 Dec 2024 13:01:13 -0500 Subject: [PATCH] Add option to disable FullText indexing even if HS is enabled (#6426) * Allow disabling fulltext indexing only * Test fix * Test fixes * Test fix * Test fix * Compile fix * Test fixes * Fixes * FIx job name * Startup fix * Add changelog * Cleanup * Cleanup * Docs update * Cleanup * Tests * Test fixes * Cleanup * Version bump --- hapi-deployable-pom/pom.xml | 2 +- hapi-fhir-android/pom.xml | 2 +- hapi-fhir-base/pom.xml | 2 +- .../ca/uhn/fhir/i18n/hapi-messages.properties | 1 + hapi-fhir-bom/pom.xml | 4 +- hapi-fhir-checkstyle/pom.xml | 2 +- hapi-fhir-cli/hapi-fhir-cli-api/pom.xml | 2 +- hapi-fhir-cli/hapi-fhir-cli-app/pom.xml | 2 +- hapi-fhir-cli/pom.xml | 2 +- hapi-fhir-client-apache-http5/pom.xml | 2 +- hapi-fhir-client-okhttp/pom.xml | 2 +- hapi-fhir-client/pom.xml | 2 +- hapi-fhir-converter/pom.xml | 2 +- hapi-fhir-dist/pom.xml | 2 +- hapi-fhir-docs/pom.xml | 2 +- .../7_8_0/6426-allow-disabling-fulltext.yaml | 11 +++ .../hapi/fhir/changelog/7_8_0/changes.yaml | 1 + hapi-fhir-jacoco/pom.xml | 2 +- hapi-fhir-jaxrsserver-base/pom.xml | 2 +- hapi-fhir-jpa/pom.xml | 2 +- hapi-fhir-jpaserver-base/pom.xml | 2 +- .../ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java | 31 +++++++-- .../fhir/jpa/dao/BaseHapiFhirResourceDao.java | 3 +- .../fhir/jpa/dao/FulltextSearchSvcImpl.java | 15 ++++ .../fhir/jpa/dao/data/IResourceTableDao.java | 3 +- .../ca/uhn/fhir/jpa/entity/TermConcept.java | 36 ++++------ .../tasks/HapiFhirJpaMigrationTasks.java | 13 ++++ .../reindex/ResourceReindexingSvcImpl.java | 4 +- .../term/TermCodeSystemStorageSvcImpl.java | 4 +- .../uhn/fhir/jpa/term/TermConceptDaoSvc.java | 4 +- .../ca/uhn/fhir/jpa/term/TermReadSvcImpl.java | 8 --- .../pom.xml | 2 +- ...esourceDaoR4SearchWithElasticSearchIT.java | 47 ++++++++++--- hapi-fhir-jpaserver-hfql/pom.xml | 2 +- hapi-fhir-jpaserver-ips/pom.xml | 2 +- hapi-fhir-jpaserver-mdm/pom.xml | 2 +- hapi-fhir-jpaserver-model/pom.xml | 2 +- .../model/entity/EntityIndexStatusEnum.java | 18 +++++ .../fhir/jpa/model/entity/ResourceTable.java | 12 +++- .../search/ResourceTableRoutingBinder.java | 4 +- hapi-fhir-jpaserver-searchparam/pom.xml | 2 +- hapi-fhir-jpaserver-subscription/pom.xml | 2 +- hapi-fhir-jpaserver-test-dstu2/pom.xml | 2 +- .../FhirResourceDaoDstu2SearchFtTest.java | 5 +- .../jpa/dao/dstu2/FhirSearchDaoDstu2Test.java | 9 +++ .../provider/ResourceProviderDstu2Test.java | 2 + hapi-fhir-jpaserver-test-dstu3/pom.xml | 2 +- .../FhirResourceDaoDstu3SearchFtTest.java | 6 +- .../jpa/dao/dstu3/FhirSearchDaoDstu3Test.java | 11 ++- ...rceProviderCustomSearchParamDstu3Test.java | 5 +- .../dstu3/ResourceProviderDstu3Test.java | 6 ++ hapi-fhir-jpaserver-test-r4/pom.xml | 2 +- .../jpa/batch2/BulkDataErrorAbuseTest.java | 2 +- ...FhirResourceDaoR4ComboUniqueParamTest.java | 21 +++--- .../dao/r4/FhirResourceDaoR4SearchFtTest.java | 8 ++- .../jpa/dao/r4/FhirResourceDaoR4Test.java | 16 ++--- .../fhir/jpa/dao/r4/FhirSearchDaoR4Test.java | 3 + .../fhir/jpa/dao/r4/FhirSystemDaoR4Test.java | 7 +- .../jpa/dao/r4/PartitioningSqlR4Test.java | 6 +- .../jpa/delete/job/DeleteExpungeJobTest.java | 9 +++ ...sourceProviderCustomSearchParamR4Test.java | 5 +- .../r4/ResourceProviderR4EverythingTest.java | 4 ++ .../provider/r4/ResourceProviderR4Test.java | 51 ++++++++++++-- .../fhir/jpa/reindex/ReindexStepV1Test.java | 8 +-- .../ResourceReindexingSvcImplTest.java | 3 +- hapi-fhir-jpaserver-test-r4b/pom.xml | 2 +- hapi-fhir-jpaserver-test-r5/pom.xml | 2 +- hapi-fhir-jpaserver-test-utilities/pom.xml | 2 +- .../ca/uhn/fhir/jpa/test/BaseJpaTest.java | 8 +-- ...esourceDaoR4StandardQueriesLuceneTest.java | 9 +-- hapi-fhir-jpaserver-uhnfhirtest/pom.xml | 2 +- .../ca/uhn/fhirtest/config/BaseConfig.java | 23 +++++++ .../CommonJpaStorageSettingsConfigurer.java | 3 + .../uhn/fhirtest/config/TestAuditConfig.java | 7 ++ .../uhn/fhirtest/config/TestDstu2Config.java | 30 +++----- .../uhn/fhirtest/config/TestDstu3Config.java | 14 +--- .../ca/uhn/fhirtest/config/TestR4BConfig.java | 26 +++---- .../ca/uhn/fhirtest/config/TestR4Config.java | 15 +--- .../ca/uhn/fhirtest/config/TestR5Config.java | 14 +--- hapi-fhir-server-cds-hooks/pom.xml | 2 +- hapi-fhir-server-mdm/pom.xml | 2 +- hapi-fhir-server-openapi/pom.xml | 2 +- hapi-fhir-server/pom.xml | 2 +- .../hapi-fhir-caching-api/pom.xml | 2 +- .../hapi-fhir-caching-caffeine/pom.xml | 4 +- .../hapi-fhir-caching-guava/pom.xml | 2 +- .../hapi-fhir-caching-testing/pom.xml | 2 +- hapi-fhir-serviceloaders/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../hapi-fhir-spring-boot-samples/pom.xml | 2 +- .../hapi-fhir-spring-boot-starter/pom.xml | 2 +- hapi-fhir-spring-boot/pom.xml | 2 +- hapi-fhir-sql-migrate/pom.xml | 2 +- hapi-fhir-storage-batch2-jobs/pom.xml | 2 +- .../pom.xml | 2 +- hapi-fhir-storage-batch2/pom.xml | 2 +- hapi-fhir-storage-cr/pom.xml | 2 +- hapi-fhir-storage-mdm/pom.xml | 2 +- hapi-fhir-storage-test-utilities/pom.xml | 2 +- hapi-fhir-storage/pom.xml | 2 +- .../jpa/api/config/JpaStorageSettings.java | 68 +++++++++++++++++-- hapi-fhir-structures-dstu2.1/pom.xml | 2 +- hapi-fhir-structures-dstu2/pom.xml | 2 +- hapi-fhir-structures-dstu3/pom.xml | 2 +- hapi-fhir-structures-hl7org-dstu2/pom.xml | 2 +- hapi-fhir-structures-r4/pom.xml | 2 +- hapi-fhir-structures-r4b/pom.xml | 2 +- hapi-fhir-structures-r5/pom.xml | 2 +- hapi-fhir-test-utilities/pom.xml | 2 +- hapi-fhir-testpage-overlay/pom.xml | 2 +- .../pom.xml | 2 +- hapi-fhir-validation-resources-dstu2/pom.xml | 2 +- hapi-fhir-validation-resources-dstu3/pom.xml | 2 +- hapi-fhir-validation-resources-r4/pom.xml | 2 +- hapi-fhir-validation-resources-r4b/pom.xml | 2 +- hapi-fhir-validation-resources-r5/pom.xml | 2 +- hapi-fhir-validation/pom.xml | 2 +- hapi-tinder-plugin/pom.xml | 2 +- hapi-tinder-test/pom.xml | 2 +- pom.xml | 6 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- 126 files changed, 508 insertions(+), 275 deletions(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/6426-allow-disabling-fulltext.yaml create mode 100644 hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/EntityIndexStatusEnum.java create mode 100644 hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/BaseConfig.java diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml index 1d11db11e80..68c007a1290 100644 --- a/hapi-deployable-pom/pom.xml +++ b/hapi-deployable-pom/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml index 8d4dac888ef..208819cb36f 100644 --- a/hapi-fhir-android/pom.xml +++ b/hapi-fhir-android/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index 43df2e2b214..170b1eab71f 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties index def641589f0..6e6a62f1b0e 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties @@ -163,6 +163,7 @@ ca.uhn.fhir.jpa.term.TermConceptMappingSvcImpl.matchesFound=Matches found ca.uhn.fhir.jpa.term.TermConceptMappingSvcImpl.noMatchesFound=No Matches found ca.uhn.fhir.jpa.term.TermConceptMappingSvcImpl.onlyNegativeMatchesFound=Only negative matches found +ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl.fullTextSearchingNotPossible=Fulltext searching is not enabled on this server, can not support the parameter(s): {0} ca.uhn.fhir.jpa.dao.JpaResourceDaoSearchParameter.invalidSearchParamExpression=The expression "{0}" can not be evaluated and may be invalid: {1} ca.uhn.fhir.jpa.search.builder.QueryStack.textModifierDisabledForSearchParam=The :text modifier is disabled for this search parameter diff --git a/hapi-fhir-bom/pom.xml b/hapi-fhir-bom/pom.xml index 1eb93287a5e..bd23f65175d 100644 --- a/hapi-fhir-bom/pom.xml +++ b/hapi-fhir-bom/pom.xml @@ -4,7 +4,7 @@ 4.0.0 ca.uhn.hapi.fhir hapi-fhir-bom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT pom HAPI FHIR BOM @@ -12,7 +12,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-checkstyle/pom.xml b/hapi-fhir-checkstyle/pom.xml index a3e43a48a50..3cb89480f52 100644 --- a/hapi-fhir-checkstyle/pom.xml +++ b/hapi-fhir-checkstyle/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml index fab897561a8..4f5afc89046 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml +++ b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml index 99309197db0..edfcdbe5148 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml +++ b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-fhir-cli - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml index 9eb4b10c00a..6216c8253cc 100644 --- a/hapi-fhir-cli/pom.xml +++ b/hapi-fhir-cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-client-apache-http5/pom.xml b/hapi-fhir-client-apache-http5/pom.xml index f38adc3014b..202e46281ae 100644 --- a/hapi-fhir-client-apache-http5/pom.xml +++ b/hapi-fhir-client-apache-http5/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-client-okhttp/pom.xml b/hapi-fhir-client-okhttp/pom.xml index 88edde5fc22..8c2cbc9adaf 100644 --- a/hapi-fhir-client-okhttp/pom.xml +++ b/hapi-fhir-client-okhttp/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-client/pom.xml b/hapi-fhir-client/pom.xml index 5d7c72e9da9..a43eb2ee48a 100644 --- a/hapi-fhir-client/pom.xml +++ b/hapi-fhir-client/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-converter/pom.xml b/hapi-fhir-converter/pom.xml index 380ff4df5f6..ac8c1c1edf6 100644 --- a/hapi-fhir-converter/pom.xml +++ b/hapi-fhir-converter/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml index c2aac03bba4..b5a5c1fc195 100644 --- a/hapi-fhir-dist/pom.xml +++ b/hapi-fhir-dist/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-docs/pom.xml b/hapi-fhir-docs/pom.xml index d3be55b7927..28f8b998f16 100644 --- a/hapi-fhir-docs/pom.xml +++ b/hapi-fhir-docs/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 7.7.12-SNAPSHOT + 7.7.13-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/6426-allow-disabling-fulltext.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/6426-allow-disabling-fulltext.yaml new file mode 100644 index 00000000000..f670d8bcf0d --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/6426-allow-disabling-fulltext.yaml @@ -0,0 +1,11 @@ +--- +type: add +issue: 6426 +title: "Previously, it was not possible to enable Hibernate Search but not use it + for fulltext indexing. This meant that you could not enable HS-based terminology + services without also enabling fulltext indexing of all resources. A new setting + has been added to the JpaStorageSettings bean + called `HibernateSearchIndexFullText` which controls whether HS will be used for + fulltext indexing. The existing property `AdvancedHSearchIndexing` has also been + deprecated and a new equivalent (but better named) property + called `HibernateSearchIndexSearchParams`." diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/changes.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/changes.yaml index fd1d5d2cd55..d232f171908 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/changes.yaml +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/changes.yaml @@ -5,6 +5,7 @@ (dependent HAPI modules listed in brackets):