Package org.alfresco.repo.search
Interface Indexer
- All Known Implementing Classes:
IndexerComponent,NoActionIndexer,NoIndexIndexer
public interface Indexer
This interface abstracts how indexing is used from within the node service implementation.
It has to optionally offer transactional integration For example, the lucene indexer
- Author:
- andyh
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateChildRelationship(ChildAssociationRef relationshipRef) Create a refernce link between a parent and child.voidcreateNode(ChildAssociationRef relationshipRef) Create an index entry when a new node is created.voiddeleteChildRelationship(ChildAssociationRef relationshipRef) Delete a relationship between a parent and child.voiddeleteIndex(StoreRef storeRef) Delete the index for a storevoiddeleteNode(ChildAssociationRef relationshipRef) Delete a node entry from an index.voiddetectNodeChanges(NodeRef nodeRef, SearchService searcher, Collection<ChildAssociationRef> addedParents, Collection<ChildAssociationRef> deletedParents, Collection<ChildAssociationRef> createdNodes, Collection<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 requiredvoidvoidsetReadThrough(boolean isReadThrough) Activates 'read through' behaviour for this indexer.voidupdateChildRelationship(ChildAssociationRef relationshipBeforeRef, ChildAssociationRef relationshipAfterRef) Alter the relationship between parent and child nodes in the index.voidupdateNode(NodeRef nodeRef) Update an index entry due to property changes on a node.
-
Method Details
-
createNode
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
Update an index entry due to property changes on a node. There are no strucural impications from such a change.- Parameters:
nodeRef- NodeRef
-
deleteNode
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
Create a refernce link between a parent and child. Implies only (potential) structural changes- Parameters:
relationshipRef- ChildAssociationRef
-
updateChildRelationship
void updateChildRelationship(ChildAssociationRef relationshipBeforeRef, ChildAssociationRef relationshipAfterRef) Alter the relationship between parent and child nodes in the index. This can be used for:- rename,
- move,
- move and rename,
- replace
- Parameters:
relationshipBeforeRef- ChildAssociationRefrelationshipAfterRef- ChildAssociationRef
-
deleteChildRelationship
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(NodeRef nodeRef, SearchService searcher, Collection<ChildAssociationRef> addedParents, Collection<ChildAssociationRef> deletedParents, Collection<ChildAssociationRef> createdNodes, Collection<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 processsearcher- searcher to query the indexesaddedParents- set to add new secondary parent associations todeletedParents- set to add removed secondary parent associations tocreatedNodes- set to add created nodes toupdatedNodes- set to add updated nodes to
-
deleteIndex
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
-