From 07f879d276ba80583e988ed65d67d6c6eeb22218 Mon Sep 17 00:00:00 2001 From: Etienne Poirier <33007955+epeartree@users.noreply.github.com> Date: Mon, 22 Apr 2024 18:46:43 -0400 Subject: [PATCH] Postgres terminology service hard coded column names migration (#5866) * updating parent pids column name * updating name of the fullTestField Search * updating name of the fullTestField Search * fixing typo. * failing test. * - Moving FullTextField annotation from getter method and adding it to the newly added VC property of the entity; - reverting the name of the FullTextField entity to its previous name of 'myParentPids'; - reverting the name of the lucene index to search on in the terminology service. - updating the changelog; * making spotless happy --------- Co-authored-by: peartree --- ...-updating-name-of-full-text-field-search.yaml | 5 +++++ .../java/ca/uhn/fhir/jpa/entity/TermConcept.java | 16 +++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5865-updating-name-of-full-text-field-search.yaml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5865-updating-name-of-full-text-field-search.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5865-updating-name-of-full-text-field-search.yaml new file mode 100644 index 00000000000..358a0e4276a --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5865-updating-name-of-full-text-field-search.yaml @@ -0,0 +1,5 @@ +--- +type: fix +issue: 5865 +title: "Moving the Hibernate.Search annotation for text indexing from the lob column to the column added as part of the + PostgreSql LOB migration." diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConcept.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConcept.java index 57674d4cfc7..e8b644fd355 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConcept.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConcept.java @@ -43,7 +43,6 @@ import jakarta.persistence.SequenceGenerator; import jakarta.persistence.Table; import jakarta.persistence.Temporal; import jakarta.persistence.TemporalType; -import jakarta.persistence.Transient; import jakarta.persistence.UniqueConstraint; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; @@ -58,10 +57,7 @@ import org.hibernate.search.mapper.pojo.bridge.mapping.annotation.RoutingBinderR import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ObjectPath; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.PropertyBinding; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.PropertyValue; import org.hl7.fhir.r4.model.Coding; import java.io.Serializable; @@ -177,6 +173,11 @@ public class TermConcept implements Serializable { @Column(name = "PARENT_PIDS", nullable = true) private String myParentPids; + @FullTextField( + name = "myParentPids", + searchable = Searchable.YES, + projectable = Projectable.YES, + analyzer = "conceptParentPidsAnalyzer") @Column(name = "PARENT_PIDS_VC", nullable = true, length = Length.LONG32) private String myParentPidsVc; @@ -362,13 +363,6 @@ public class TermConcept implements Serializable { return this; } - @Transient - @FullTextField( - name = "myParentPids", - searchable = Searchable.YES, - projectable = Projectable.YES, - analyzer = "conceptParentPidsAnalyzer") - @IndexingDependency(derivedFrom = @ObjectPath({@PropertyValue(propertyName = "myParentPidsVc")})) public String getParentPidsAsString() { return nonNull(myParentPidsVc) ? myParentPidsVc : myParentPids; }