@GET
    @ApiOperation(value = "Retrieve a search query")
    @Path("{id}")
    @Produces({MediaType.APPLICATION_JSON, SEARCH_FORMAT_V1})
    public SearchDTO getSearch(@ApiParam(name = "id") @PathParam("id") String searchId, @Context SearchUser searchUser) {
        final Search search = searchDomain.getForUser(searchId, searchUser)
                .orElseThrow(() -> new NotFoundException("Search with id " + searchId + " does not exist"));
        return SearchDTO.fromSearch(search);
    }
@Test
    public void getSearchLoadsSearch() {
        final Query query = Query.builder()
                .id("queryId")
                .searchTypes(Collections.emptySet())
                .filter(StreamFilter.anyIdOf("streamId"))
                .build();

        final Search search = Search.builder()
                .id("deadbeef")
                .parameters(ImmutableSet.of())
                .queries(ImmutableSet.of(query))
                .build();

        final SearchDomain searchDomain = mockSearchDomain(Optional.of(search));
        final SearchResource resource = new SearchResource(searchDomain, searchExecutor, searchJobService, eventBus, clusterConfigService);
        final SearchDTO returnedSearch = resource.getSearch(search.id(), searchUser);

        assertThat(returnedSearch.id()).isEqualTo(search.id());
    }