-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Update OpenSearch service to use new SearchRequest DTO; str…
…eamline query execution and enhance response handling
- Loading branch information
Showing
15 changed files
with
103 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: dolly-search-service | ||
|
||
on: | ||
push: | ||
paths: | ||
- "plugins/**" | ||
- "libs/data-transfer-search-objects/**" | ||
- "libs/reactive-core/**" | ||
- "libs/security-core/**" | ||
- "libs/servlet-core/**" | ||
- "libs/servlet-security/**" | ||
- "apps/dolly-search-service/**" | ||
- ".github/workflows/app.dolly-search-service.yml" | ||
|
||
jobs: | ||
workflow: | ||
uses: ./.github/workflows/common.workflow.backend.yml | ||
with: | ||
working-directory: "apps/dolly-search-service" | ||
deploy-tag: "#deploy-dolly-search-service" | ||
permissions: | ||
contents: read | ||
id-token: write | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...lly-search-service/src/main/java/no/nav/testnav/dollysearchservice/dto/SearchRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package no.nav.testnav.dollysearchservice.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SearchRequest { | ||
|
||
private no.nav.testnav.libs.data.dollysearchservice.v1.SearchRequest request; | ||
private org.opensearch.action.search.SearchRequest query; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 4 additions & 12 deletions
16
...ervice/src/main/java/no/nav/testnav/dollysearchservice/provider/OpensearchController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,27 @@ | ||
package no.nav.testnav.dollysearchservice.provider; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.RequiredArgsConstructor; | ||
import no.nav.testnav.dollysearchservice.service.OpenSearchService; | ||
import no.nav.testnav.libs.data.dollysearchservice.v1.SearchRequest; | ||
import no.nav.testnav.libs.data.dollysearchservice.v1.SearchResponse; | ||
import no.nav.testnav.dollysearchservice.service.OpenSearchService; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import reactor.core.publisher.Mono; | ||
|
||
@RestController | ||
@RequestMapping("/api/v1/elastic") | ||
@RequestMapping("/api/v1/opensearch") | ||
@RequiredArgsConstructor | ||
public class OpensearchController { | ||
|
||
private final OpenSearchService openSearchService; | ||
|
||
@PostMapping("/identer") | ||
@Operation(description = "Henter identer som matcher søk i request, både registre og persondetaljer") | ||
public Mono<SearchResponse> getIdenterMed(@RequestBody SearchRequest request, | ||
@Schema(description = "Sidenummer") | ||
@RequestParam(required = false) Integer side, | ||
@Schema(description = "Antall resultater per side") | ||
@RequestParam(required = false) Integer antall, | ||
@Schema(description = "Seed for paginering") | ||
@RequestParam(required = false) Integer seed) { | ||
public Mono<SearchResponse> getIdenterMed(@RequestBody SearchRequest request) { | ||
|
||
return openSearchService.search(request, side, antall, seed); | ||
return openSearchService.search(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters