Interface Indexer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void createChildRelationship​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
      Create a refernce link between a parent and child.
      void createNode​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
      Create an index entry when a new node is created.
      void deleteChildRelationship​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
      Delete a relationship between a parent and child.
      void deleteIndex​(org.alfresco.service.cmr.repository.StoreRef storeRef)
      Delete the index for a store
      void deleteNode​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
      Delete a node entry from an index.
      void detectNodeChanges​(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.search.SearchService searcher, java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> addedParents, java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> deletedParents, java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> createdNodes, java.util.Collection<org.alfresco.service.cmr.repository.NodeRef> updatedNodes)
      Does a database vs index comparison for the given created/updated/renamed/referenced nodeRef in order to determine the set of indexing operations required
      void flushPending()  
      void setReadThrough​(boolean isReadThrough)
      Activates 'read through' behaviour for this indexer.
      void updateChildRelationship​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipBeforeRef, org.alfresco.service.cmr.repository.ChildAssociationRef relationshipAfterRef)
      Alter the relationship between parent and child nodes in the index.
      void updateNode​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Update an index entry due to property changes on a node.
    • Method Detail

      • createNode

        void createNode​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
        Create an index entry when a new node is created. A node is always created with a name in a given parent and so a relationship ref is required.
        Parameters:
        relationshipRef - ChildAssociationRef
      • updateNode

        void updateNode​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Update an index entry due to property changes on a node. There are no strucural impications from such a change.
        Parameters:
        nodeRef - NodeRef
      • deleteNode

        void deleteNode​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
        Delete a node entry from an index. This implies structural change. The node will be deleted from the index. This will also remove any remaining refernces to the node from the index. The index has no idea of the primary link.
        Parameters:
        relationshipRef - ChildAssociationRef
      • createChildRelationship

        void createChildRelationship​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
        Create a refernce link between a parent and child. Implies only (potential) structural changes
        Parameters:
        relationshipRef - ChildAssociationRef
      • updateChildRelationship

        void updateChildRelationship​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipBeforeRef,
                                     org.alfresco.service.cmr.repository.ChildAssociationRef relationshipAfterRef)
        Alter the relationship between parent and child nodes in the index. This can be used for:
        1. rename,
        2. move,
        3. move and rename,
        4. replace
        This could be implemented as a delete and add but some implementations may be able to optimise this operation.
        Parameters:
        relationshipBeforeRef - ChildAssociationRef
        relationshipAfterRef - ChildAssociationRef
      • deleteChildRelationship

        void deleteChildRelationship​(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
        Delete a relationship between a parent and child. This will remove a structural route through the index. The index has no idea of reference and primary relationships and will happily remove the primary relationship before refernces which could remain. Use delete to ensure all strctural references are removed or call this sure you are doing an unlink (remove a hard link in the unix file system world).
        Parameters:
        relationshipRef - ChildAssociationRef
      • detectNodeChanges

        void detectNodeChanges​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                               org.alfresco.service.cmr.search.SearchService searcher,
                               java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> addedParents,
                               java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> deletedParents,
                               java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> createdNodes,
                               java.util.Collection<org.alfresco.service.cmr.repository.NodeRef> updatedNodes)
        Does a database vs index comparison for the given created/updated/renamed/referenced nodeRef in order to determine the set of indexing operations required
        Parameters:
        nodeRef - the nodeRef to process
        searcher - searcher to query the indexes
        addedParents - set to add new secondary parent associations to
        deletedParents - set to add removed secondary parent associations to
        createdNodes - set to add created nodes to
        updatedNodes - set to add updated nodes to
      • deleteIndex

        void deleteIndex​(org.alfresco.service.cmr.repository.StoreRef storeRef)
        Delete the index for a store
        Parameters:
        storeRef - StoreRef
      • flushPending

        void flushPending()
      • setReadThrough

        void setReadThrough​(boolean isReadThrough)
        Activates 'read through' behaviour for this indexer. Rather than accessing the database through the current (potentially old) transaction, it will use a discrete read only transaction for each node it indexes. This avoids 'stale' nodes building up in the caches during long reindex runs.
        Parameters:
        isReadThrough - boolean