Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. @RequestMapping(value = "/search", method = RequestMethod.POST)
  2. public @ResponseBody List<PoemSearchProxy> search(@RequestParam("query") String query,
  3. @RequestParam("missAudio") Boolean hasMissingRecordsOnly,
  4. @RequestParam("onlyWithTranslation") Boolean onlyWithTranslation) {
  5. List<Poem> poems = null;
  6.  
  7. if (query.equals("")) {
  8. poems = (List<Poem>) poemRepo.findAll();
  9. System.out.println("PoemA:" + poems.get(0).getAuthorFamilyName());
  10. } else {
  11. String lowerQuery = query.toLowerCase();
  12. poems = (List<Poem>) poemRepo.findByKeywords(prepareRegexKeywords(lowerQuery));
  13. System.out.println("Poem:" + poems.get(0).getAuthorFamilyName());
  14. }
  15.  
  16. List<PoemSearchProxy> webPoems = createWebPoem(poems, hasMissingRecordsOnly, onlyWithTranslation);
  17. System.out.println("WebPoem:" + webPoems.get(0).getAuthorFamilyName());
  18. return webPoems;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement