diff options
Diffstat (limited to 'vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java')
-rw-r--r-- | vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java index f6a6ed05e57..18628af3eca 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java @@ -204,14 +204,16 @@ public class RestApi extends LoggingRequestHandler { } private HttpResponse handleVisit(RestUri restUri, HttpRequest request) throws RestApiException { + String documentSelection = Optional.ofNullable(request.getProperty(SELECTION)).orElse(""); if (restUri.getGroup().isPresent() && ! restUri.getGroup().get().value.isEmpty()) { - return Response.createErrorResponse( - 400, - "Visiting does not support setting value for group/value, try using expression parameter instead.", - restUri); - + if (! documentSelection.isEmpty()) { + return Response.createErrorResponse( + 400, + "Visiting does not support setting value for group/value in combination with expression, try using only expression parameter instead.", + restUri); + } + documentSelection = "id.group='" + restUri.getGroup().get().value + "'"; } - String documentSelection = Optional.ofNullable(request.getProperty(SELECTION)).orElse(""); Optional<String> cluster = Optional.ofNullable(request.getProperty(CLUSTER)); Optional<String> continuation = Optional.ofNullable(request.getProperty(CONTINUATION)); final OperationHandler.VisitResult visit = operationHandler.visit(restUri, documentSelection, cluster, continuation); |