ALF-9856: RSOLR 046: Index track and build from SOLR: ALF-9857 Track changes to PATH and optimised support for getting AUX doc only data

- path tracking complete

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29758 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2011-08-15 12:57:19 +00:00
parent 8bdaffcfe2
commit a73cccdc8b
3 changed files with 49 additions and 5 deletions

View File

@@ -471,6 +471,7 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
boolean includeParentAssociations = (resultFilter == null ? true : resultFilter.getIncludeParentAssociations());
boolean includeChildAssociations = (resultFilter == null ? true : resultFilter.getIncludeChildAssociations());
boolean includeOwner = (resultFilter == null ? true : resultFilter.getIncludeOwner());
boolean includeChildIds = (resultFilter == null ? true : resultFilter.getIncludeChildIds());
List<Long> nodeIds = preCacheNodes(nodeMetaDataParameters);
@@ -497,19 +498,18 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
nodeMetaData.setNodeType(nodeType);
}
if(includePaths || includeProperties)
if(includeProperties)
{
props = nodeDAO.getNodeProperties(nodeId);
}
nodeMetaData.setProperties(props);
if(includePaths || includeAspects)
if(includeAspects)
{
aspects = nodeDAO.getNodeAspects(nodeId);
}
nodeMetaData.setAspects(aspects);
// TODO paths may change during get i.e. node moved around in the graph
if(includePaths)
{
Collection<Pair<Path, QName>> categoryPaths = getCategoryPaths(pair.getSecond(), aspects, props);
@@ -556,6 +556,33 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
});
nodeMetaData.setChildAssocs(childAssocs);
}
if(includeChildIds)
{
final List<Long> childIds = new ArrayList<Long>(100);
nodeDAO.getChildAssocs(nodeId, null, null, null, null, null, new ChildAssocRefQueryCallback()
{
@Override
public boolean preLoadNodes()
{
return false;
}
@Override
public boolean handle(Pair<Long, ChildAssociationRef> childAssocPair, Pair<Long, NodeRef> parentNodePair,
Pair<Long, NodeRef> childNodePair)
{
childIds.add(childNodePair.getFirst());
return true;
}
@Override
public void done()
{
}
});
nodeMetaData.setChildIds(childIds);
}
if(includeParentAssociations)
{