Skip to content

Commit

Permalink
Elasticsearch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samleeflang committed Oct 5, 2022
1 parent 1136648 commit a0bf3df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public List<DigitalSpecimen> 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();
Expand All @@ -42,7 +42,7 @@ public List<DigitalSpecimen> search(String query, int pageNumber, int pageSize)
public List<DigitalSpecimen> 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();
Expand All @@ -54,7 +54,7 @@ public List<DigitalSpecimen> getLatestSpecimen() throws IOException {
public List<AnnotationResponse> 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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit a0bf3df

Please sign in to comment.