private Mono<ServerResponse> search(ServerRequest request) {
        return Mono.fromSupplier(
                () -> new SearchParam(request.queryParams()))
            .map(param -> {
                var option = new SearchOption();
                option.setIncludeTypes(List.of(PostHaloDocumentsProvider.POST_DOCUMENT_TYPE));

                option.setKeyword(param.getKeyword());
                option.setLimit(param.getLimit());
                option.setHighlightPreTag(param.getHighlightPreTag());
                option.setHighlightPostTag(param.getHighlightPostTag());
                return option;
            })
            .flatMap(this::performSearch)
            .flatMap(result -> ServerResponse.ok().bodyValue(result));
    }
@Test
    void shouldResponseBadRequestIfRequestBodyValidationFailed() {
        var option = new SearchOption();
        var errors = mock(Errors.class);
        when(searchService.search(any(SearchOption.class)))
            .thenReturn(Mono.error(new RequestBodyValidationException(errors)));

        client.post().uri("/indices/-/search")
            .bodyValue(option)
            .exchange()
            .expectStatus().isBadRequest();
    }