diff --git a/src/main/java/tla/backend/api/EntityController.java b/src/main/java/tla/backend/api/EntityController.java index ce33743b..e212e60a 100644 --- a/src/main/java/tla/backend/api/EntityController.java +++ b/src/main/java/tla/backend/api/EntityController.java @@ -2,6 +2,7 @@ import java.util.List; +import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.http.HttpStatus; @@ -106,9 +107,10 @@ public ResponseEntity count() { produces = MediaType.APPLICATION_JSON_VALUE ) public ResponseEntity> search(@RequestBody SearchCommand command, Pageable page) { - log.info("page: {}", tla.domain.util.IO.json(page)); + Pageable page10 = PageRequest.of(page.getPageNumber(), 10); //sets page size to 10 + log.info("page: {}", tla.domain.util.IO.json(page10)); log.info("command: {}", tla.domain.util.IO.json(command)); - var result = this.getService().runSearchCommand(command, page); + var result = this.getService().runSearchCommand(command, page10); return new ResponseEntity>( result.orElseThrow( () -> new ObjectNotFoundException(getService().getModelClass().getName()) @@ -117,4 +119,4 @@ public ResponseEntity> search(@RequestBody SearchCommand ); } -} \ No newline at end of file +}