class ReindexController {

    @RequestMapping(value = "/reindex", method = RequestMethod.GET)
    public void reindex(final HttpServletResponse response) {
        indexTaskScheduler.runReindexOnDemand();
        PrintWriter writer;
        try {
            writer = response.getWriter();
            writer.write("Reindexing!");
            writer.flush();
        } catch (IOException e) {
            logger.info("error occurred when accessing /reindex", e);
        }
    }

}