mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -35,6 +35,7 @@ public class MetaDataResultsFilter
|
||||
private boolean includeParentAssociations = true;
|
||||
private boolean includeChildAssociations = true;
|
||||
private boolean includeNodeRef = true;
|
||||
private boolean includeChildIds = true;
|
||||
|
||||
public boolean getIncludeChildAssociations()
|
||||
{
|
||||
@@ -108,5 +109,13 @@ public class MetaDataResultsFilter
|
||||
{
|
||||
this.includePaths = includePaths;
|
||||
}
|
||||
public boolean getIncludeChildIds()
|
||||
{
|
||||
return includeChildIds;
|
||||
}
|
||||
public void setIncludeChildIds(boolean includeChildIds)
|
||||
{
|
||||
this.includeChildIds = includeChildIds;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -48,6 +48,7 @@ public class NodeMetaData
|
||||
private List<ChildAssociationRef> childAssocs;
|
||||
private List<ChildAssociationRef> parentAssocs;
|
||||
private Long parentAssocsCrc;
|
||||
private List<Long> childIds;
|
||||
|
||||
public String getOwner()
|
||||
{
|
||||
@@ -139,5 +140,12 @@ public class NodeMetaData
|
||||
{
|
||||
return parentAssocsCrc;
|
||||
}
|
||||
|
||||
public List<Long> getChildIds()
|
||||
{
|
||||
return childIds;
|
||||
}
|
||||
public void setChildIds(List<Long> childIds)
|
||||
{
|
||||
this.childIds = childIds;
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
@@ -557,6 +557,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)
|
||||
{
|
||||
final List<ChildAssociationRef> parentAssocs = new ArrayList<ChildAssociationRef>(100);
|
||||
|
Reference in New Issue
Block a user