diff --git a/src/main/java/eu/dissco/backend/repository/ElasticSearchRepository.java b/src/main/java/eu/dissco/backend/repository/ElasticSearchRepository.java index 557e3e9b..b6a0b713 100644 --- a/src/main/java/eu/dissco/backend/repository/ElasticSearchRepository.java +++ b/src/main/java/eu/dissco/backend/repository/ElasticSearchRepository.java @@ -30,7 +30,7 @@ public List search(String query, int pageNumber, int pageSize) } var searchRequest = new SearchRequest.Builder() .index("new-dissco") - .q("_exists_:digitalSpecimen AND " + query) + .q("_exists_:digitalSpecimen.physicalSpecimenId AND " + query) .from(offset) .size(pageSize) .build(); @@ -42,7 +42,7 @@ public List search(String query, int pageNumber, int pageSize) public List getLatestSpecimen() throws IOException { var searchRequest = new SearchRequest.Builder() .index("new-dissco") - .q("_exists_:digitalSpecimen ") + .q("_exists_:digitalSpecimen.physicalSpecimenId ") .sort(s -> s.field(f -> f.field("created").order(SortOrder.Desc))) .size(10) .build(); @@ -54,7 +54,7 @@ public List getLatestSpecimen() throws IOException { public List getLatestAnnotation() throws IOException { var searchRequest = new SearchRequest.Builder() .index("new-dissco") - .q("_exists_:annotation ") + .q("_exists_:annotation.type ") .sort(s -> s.field(f -> f.field("created").order(SortOrder.Desc))) .size(10) .build(); diff --git a/src/main/java/eu/dissco/backend/service/AnnotationService.java b/src/main/java/eu/dissco/backend/service/AnnotationService.java index 184e1f7d..1141b4c8 100644 --- a/src/main/java/eu/dissco/backend/service/AnnotationService.java +++ b/src/main/java/eu/dissco/backend/service/AnnotationService.java @@ -1,6 +1,5 @@ package eu.dissco.backend.service; -import co.elastic.clients.elasticsearch.ElasticsearchClient; import com.fasterxml.jackson.databind.JsonNode; import eu.dissco.backend.client.AnnotationClient; import eu.dissco.backend.domain.AnnotationEvent;