ACL 보안과 함께 Spring Security를 사용하여 응용 프로그램의 문서를 보호합니다. 반면에 나는 문서를 검색하기 위해 최대 절전 모드 검색 (lucene 상단에)을 사용한다. 이 검색은 페이징도 지원합니다. (문서는 데이터베이스에 저장된 문서의 메타 데이터입니다.)Hibernate Search (Lucene)와 페이징 및 ACL을 결합하는 방법
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
QueryBuilder queryBuilder = fullTextEntityManager.getSearchFactory().buildQueryBuilder().forEntity(Document.class).get();
Query query = queryBuilder.keyword().onFields(fieldNames.toArray(new String[0])).matching(searchQuery)
.createQuery();
FullTextQuery fullTextQuery = fullTextEntityManager.createFullTextQuery(query, Document.class);
fullTextQuery.setFirstResult(pageable.getFirstItem());
fullTextQuery.setMaxResults(pageable.getPageSize());
지금은 ACL을 사용하여 페이징을 결합해야합니다. 필자가 가지고있는 유일한 아이디어는 FullTextQuery 페이징 폼을 제거하고 모든 검색 결과 문서를 읽고, ACL에 따라 필터링 한 다음 수동으로 페이징을 수행하는 것입니다. 그러나 나는 그 해결책을 좋아하지 않는다. 페이지를위한 것이 아니라 모든 문서를 적재하기 때문이다.
누구에게 더 좋은 아이디어가 있습니까?