cancel
Showing results for 
Search instead for 
Did you mean: 

Association/link deletion bug? (lucene indexes deleting)

marcus
Champ in-the-making
Champ in-the-making
(This may be related to http://issues.alfresco.com/browse/AWC-971 , but that doesn't go into too much detail…)

I am creating an association from a target node to an existing node using nodeService.addChild(targetNode, existingNode, …), so that existingNode now has two parents (its original parent and targetNode). This works exactly as I want, with the node appearing in both parts of the tree, and lucene searches pick up the node in both trees.

I've come across 2 issues;

1) If I delete the tree the linked node exists in, the original node still exists in its tree (as expected), but all the lucene index information for the node has been deleted.

2) Not such a big problem, but it seems to work differently to the above delete scenario. If I delete the node directly in its new location (or even the original location, it deletes the whole node, but it'd be nice if the delete routine first checked to see if the node was still linked in other locations before deleting it entirely, deleting only the association if still linked.

Should I log this in Jira?
2 REPLIES 2

andy
Champ on-the-rise
Champ on-the-rise
Hi Marcus

The first issue is raised and wil be fixed shortly.
http://issues.alfresco.com/browse/AR-954

Removing a non primary association will remove the data from the index.
It should not.

The behaviour should be as follows. If the primary associatoin is deleted, the node will be deleted along with al the seconday associtaions. If a secondary association is deleted - only this information should be removed - the primary and other secondary associations will remain.

Regards

Andy

marcus
Champ in-the-making
Champ in-the-making
Excellent, don't know how I missed that one when searching, but thanks Andy. This might be better suited to the tech discussion forum, but is there a specific reason for the "primary" flag on the association (or, why should one link be weighted as more important than others)? Is there a reason for deleting every reference to the node if the "primary" association is deleted? Why isn't the node only deleted when the last link to the node is removed?