From 6b9f2f986a641b28c2d88b5f084c3f34d22b6b10 Mon Sep 17 00:00:00 2001 From: alexsilaghi Date: Mon, 9 Dec 2024 13:47:29 +0200 Subject: [PATCH] added projectid index --- .../model/EntityCustomScalesValuesHistory.java | 4 ++-- .../model/EntityPostCoordinationHistory.java | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/EntityCustomScalesValuesHistory.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/EntityCustomScalesValuesHistory.java index 46ae113..b0cb7f0 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/EntityCustomScalesValuesHistory.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/EntityCustomScalesValuesHistory.java @@ -24,11 +24,11 @@ public class EntityCustomScalesValuesHistory { public static final String PROJECT_ID = "projectId"; public static final String CUSTOM_SCALE_REVISIONS = "postCoordinationCustomScalesRevisions"; @Field(WHOFIC_ENTITY_IRI) - @Indexed(name = "entityIriScales") + @Indexed(name = "entityIriScales_idx") private final String whoficEntityIri; @Field(PROJECT_ID) - @Indexed(name = "entityProjectId") + @Indexed(name = "entityProjectId_idx") private final String projectId; @Field(CUSTOM_SCALE_REVISIONS) diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/EntityPostCoordinationHistory.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/EntityPostCoordinationHistory.java index 9d58ba4..74687a5 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/EntityPostCoordinationHistory.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/EntityPostCoordinationHistory.java @@ -1,6 +1,8 @@ package edu.stanford.protege.webprotege.postcoordinationservice.model; import com.fasterxml.jackson.annotation.*; +import org.springframework.data.mongodb.core.index.CompoundIndex; +import org.springframework.data.mongodb.core.index.CompoundIndexes; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.*; @@ -8,6 +10,9 @@ @JsonIgnoreProperties(ignoreUnknown = true) @Document(collection = EntityPostCoordinationHistory.POSTCOORDINATION_HISTORY_COLLECTION) +@CompoundIndexes({ + @CompoundIndex(name = "entity_iri_project_idx", def = "{'" + EntityPostCoordinationHistory.WHOFIC_ENTITY_IRI + "': 1, '" + EntityPostCoordinationHistory.PROJECT_ID + "': 1}") +}) public class EntityPostCoordinationHistory { @@ -18,11 +23,11 @@ public class EntityPostCoordinationHistory { public static final String SPEC_REVISIONS = "postCoordinationRevisions"; @Field(WHOFIC_ENTITY_IRI) - @Indexed(name = "entityIriSpec") + @Indexed(name = "entityIriSpec_idx") private final String whoficEntityIri; @Field(PROJECT_ID) - @Indexed(name = "entityIriProjectId") + @Indexed(name = "entityIriProjectId_idx") private final String projectId; @Field(SPEC_REVISIONS)