Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value = "/search", method = RequestMethod.POST)
- public @ResponseBody List<PoemSearchProxy> search(@RequestParam("query") String query,
- @RequestParam("missAudio") Boolean hasMissingRecordsOnly,
- @RequestParam("onlyWithTranslation") Boolean onlyWithTranslation) {
- List<Poem> poems = null;
- if (query.equals("")) {
- poems = (List<Poem>) poemRepo.findAll();
- System.out.println("PoemA:" + poems.get(0).getAuthorFamilyName());
- } else {
- String lowerQuery = query.toLowerCase();
- poems = (List<Poem>) poemRepo.findByKeywords(prepareRegexKeywords(lowerQuery));
- System.out.println("Poem:" + poems.get(0).getAuthorFamilyName());
- }
- List<PoemSearchProxy> webPoems = createWebPoem(poems, hasMissingRecordsOnly, onlyWithTranslation);
- System.out.println("WebPoem:" + webPoems.get(0).getAuthorFamilyName());
- return webPoems;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement