@Test void query() { Page<ReBlog> query = service.query("git", new PageDTO(1, 10)); query.forEach(System.out::println); }
@Override public Page<ReBlog> query(String condition, PageDTO pageDTO) { SearchQuery searchQuery = new NativeSearchQueryBuilder() .withQuery(QueryBuilders.multiMatchQuery(condition, "title", "author", "contentMarkdown", "summary")) .withPageable(PageRequest.of(pageDTO.getPage() - 1, pageDTO.getCount())) .build(); return repository.search(searchQuery); }
IReBlogEsServiceImpl implements IReBlogEsService { @Override public Page<ReBlog> query(String condition, PageDTO pageDTO) { SearchQuery searchQuery = new NativeSearchQueryBuilder() .withQuery(QueryBuilders.multiMatchQuery(condition, "title", "author", "contentMarkdown", "summary")) .withPageable(PageRequest.of(pageDTO.getPage() - 1, pageDTO.getCount())) .build(); return repository.search(searchQuery); } }
IReBlogEsServiceImpl implements IReBlogEsService { @Override public Page<ReBlog> query(String condition, PageDTO pageDTO) { SearchQuery searchQuery = new NativeSearchQueryBuilder() .withQuery(QueryBuilders.multiMatchQuery(condition, "title", "author", "contentMarkdown", "summary")) .withPageable(PageRequest.of(pageDTO.getPage() - 1, pageDTO.getCount())) .build(); return repository.search(searchQuery); } IReBlogEsServiceImpl(IReBlogEsRepository repository); }
IReBlogEsServiceImpl implements IReBlogEsService { @Override public Page<ReBlog> query(String condition, PageDTO pageDTO) { SearchQuery searchQuery = new NativeSearchQueryBuilder() .withQuery(QueryBuilders.multiMatchQuery(condition, "title", "author", "contentMarkdown", "summary")) .withPageable(PageRequest.of(pageDTO.getPage() - 1, pageDTO.getCount())) .build(); return repository.search(searchQuery); } IReBlogEsServiceImpl(IReBlogEsRepository repository); @Override ReBlog save(ReBlog reBlog); @Override void delete(ReBlog reBlog); @Override Iterable<ReBlog> getAll(); @Override long count(); @Override Page<ReBlog> query(String condition, PageDTO pageDTO); @Override void deleteAll(); }
IReBlogEsServiceImpl implements IReBlogEsService { @Override public Page<ReBlog> query(String condition, PageDTO pageDTO) { SearchQuery searchQuery = new NativeSearchQueryBuilder() .withQuery(QueryBuilders.multiMatchQuery(condition, "title", "author", "contentMarkdown", "summary")) .withPageable(PageRequest.of(pageDTO.getPage() - 1, pageDTO.getCount())) .build(); return repository.search(searchQuery); } IReBlogEsServiceImpl(IReBlogEsRepository repository); @Override ReBlog save(ReBlog reBlog); @Override void delete(ReBlog reBlog); @Override Iterable<ReBlog> getAll(); @Override long count(); @Override Page<ReBlog> query(String condition, PageDTO pageDTO); @Override void deleteAll();  }