Skip to content

Commit

Permalink
Merge pull request #502 from VolkerHartmann/redirectSearch
Browse files Browse the repository at this point in the history
Set search endpoints of 'Metadata Management' as deprecated.
  • Loading branch information
VolkerHartmann committed Apr 19, 2024
2 parents 6e3bf2c + 664d470 commit b84c20d
Showing 1 changed file with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
@RequestMapping(value = "/api/v1/metadata")
@Tag(name = "Metadata Repository")
@Schema(description = "Metadata Resource Management")
@Deprecated(since = "1.4.2", forRemoval = true)
public class MetadataSearchController {

private static final Logger LOG = LoggerFactory.getLogger(MetadataSearchController.class);
Expand All @@ -68,8 +69,10 @@ public MetadataSearchController(SearchConfiguration searchConfiguration) {
}

@PostMapping("/{schemaId}/search")
@Operation(summary = "Search for metadata document/records",
description = "Search for metadata document/records using the configured Elastic backend. "
@Operation(deprecated = true,
summary = "Search for metadata document/records",
description = "Use '/api/v1/{index}/_search' instead!"
+ "Search for metadata document/records using the configured Elastic backend. "
+ "This endpoint serves as direct proxy to the RESTful endpoint of Elastic. "
+ "In the body, a query document following the Elastic query format has to be provided. "
+ "Format errors are returned directly from Elastic. "
Expand All @@ -87,8 +90,19 @@ public MetadataSearchController(SearchConfiguration searchConfiguration) {
})
@ResponseBody
@PageableAsQueryParam
/**
* Proxy for elasticsearch.
*
* @deprecation Please use SearchController instead!
* @param body query
* @param schemaIds schemaIds which should be used for search (prefix with 'metastore-')
* @param proxy set by Spring Boot
* @param pgbl page information
* @return Prepared query with post filter for authorization.
*
*/
public ResponseEntity<?> proxy(@RequestBody JsonNode body,
@Parameter(description = "Contains all schemaIds "
@Parameter(description = "Contains all schemaIds prefixed with 'metastore-'"
+ "to which the records refer as comma-separated values. "
+ "Regular expressions are also allowed. "
+ "See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/multi-index.html", required = true) @PathVariable(value = "schemaId") String schemaIds,
Expand All @@ -103,8 +117,10 @@ public ResponseEntity<?> proxy(@RequestBody JsonNode body,
}

@PostMapping("/search")
@Operation(summary = "Search for metadata document/records",
description = "Search for metadata document/records using the configured Elastic backend. "
@Operation(deprecated = true,
summary = "Search for metadata document/records",
description = "Use '/api/v1/{index}/_search' instead!"
+ "Search for metadata document/records using the configured Elastic backend. "
+ "This endpoint serves as direct proxy to the RESTful endpoint of Elastic. "
+ "In the body, a query document following the Elastic query format has to be provided. "
+ "Format errors are returned directly from Elastic. "
Expand All @@ -122,6 +138,16 @@ public ResponseEntity<?> proxy(@RequestBody JsonNode body,
})
@ResponseBody
@PageableAsQueryParam
/**
* Proxy for elasticsearch.
*
* @deprecation Please use SearchController instead!
* @param body query
* @param proxy set by Spring Boot
* @param pgbl page information
* @return Search result.
*
*/
public ResponseEntity<?> proxy(@RequestBody JsonNode body,
ProxyExchange<JsonNode> proxy,
@Parameter(hidden = true) final Pageable pgbl) throws Exception {
Expand Down

0 comments on commit b84c20d

Please sign in to comment.