Class ESAuditChangeFinder

  • All Implemented Interfaces:
    FileSystemChangeFinder

    public class ESAuditChangeFinder
    extends AuditChangeFinder
    Override the JPA audit based change finder to execute query in ES.

    The structure of the query executed by the AuditChangeFinder is:

     
     from LogEntry log where log.repositoryId = :repositoryId
    
     + AND if ActiveRoots (activeRoots) NOT empty
    
     from LogEntry log where log.repositoryId = :repositoryId and (
     LIST_DOC_EVENTS_IDS_QUERY and ( ROOT_PATHS or COLECTIONS_PATHS) or
     (log.category = 'NuxeoDrive' and log.eventId != 'rootUnregistered') )
    
    
     if ActiveRoots EMPTY:
    
     from LogEntry log where log.repositoryId = :repositoryId and ((log.category =
     'NuxeoDrive' and log.eventId != 'rootUnregistered'))
    
     + AND (log.id > :lowerBound and log.id <= :upperBound) + order by
     log.repositoryId asc, log.eventDate desc
     
     
    Since:
    7.3
    • Constructor Detail

      • ESAuditChangeFinder

        public ESAuditChangeFinder()
    • Method Detail

      • buildFilterClauses

        protected org.elasticsearch.index.query.QueryBuilder buildFilterClauses​(CoreSession session,
                                                                                SynchronizationRoots activeRoots,
                                                                                Set<String> collectionSyncRootMemberIds,
                                                                                long lowerBound,
                                                                                long upperBound)
      • getLogIdBoundsClause

        protected org.elasticsearch.index.query.RangeQueryBuilder getLogIdBoundsClause​(long lowerBound,
                                                                                       long upperBound)
      • getCollectionSyncRootClause

        protected org.elasticsearch.index.query.TermsQueryBuilder getCollectionSyncRootClause​(Set<String> collectionSyncRootMemberIds)
      • getCurrentRootsClause

        protected org.elasticsearch.index.query.BoolQueryBuilder getCurrentRootsClause​(Set<String> rootPaths)
      • getDriveLogsQueryClause

        protected org.elasticsearch.index.query.BoolQueryBuilder getDriveLogsQueryClause()
      • getEventsClause

        protected org.elasticsearch.index.query.BoolQueryBuilder getEventsClause​(String category,
                                                                                 String[] eventIds,
                                                                                 boolean shouldMatch)
      • getClient

        protected ESClient getClient()
      • getESIndexName

        protected String getESIndexName()
      • logSearchRequest

        protected void logSearchRequest​(org.elasticsearch.action.search.SearchRequest request)
      • logSearchResponse

        protected void logSearchResponse​(org.elasticsearch.action.search.SearchResponse response)