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 includeParentAssociations = true;
|
||||||
private boolean includeChildAssociations = true;
|
private boolean includeChildAssociations = true;
|
||||||
private boolean includeNodeRef = true;
|
private boolean includeNodeRef = true;
|
||||||
|
private boolean includeChildIds = true;
|
||||||
|
|
||||||
public boolean getIncludeChildAssociations()
|
public boolean getIncludeChildAssociations()
|
||||||
{
|
{
|
||||||
@@ -107,6 +108,14 @@ public class MetaDataResultsFilter
|
|||||||
public void setIncludePaths(boolean includePaths)
|
public void setIncludePaths(boolean includePaths)
|
||||||
{
|
{
|
||||||
this.includePaths = includePaths;
|
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> childAssocs;
|
||||||
private List<ChildAssociationRef> parentAssocs;
|
private List<ChildAssociationRef> parentAssocs;
|
||||||
private Long parentAssocsCrc;
|
private Long parentAssocsCrc;
|
||||||
|
private List<Long> childIds;
|
||||||
|
|
||||||
public String getOwner()
|
public String getOwner()
|
||||||
{
|
{
|
||||||
@@ -138,6 +139,13 @@ public class NodeMetaData
|
|||||||
public Long getParentAssocsCrc()
|
public Long getParentAssocsCrc()
|
||||||
{
|
{
|
||||||
return parentAssocsCrc;
|
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 includeParentAssociations = (resultFilter == null ? true : resultFilter.getIncludeParentAssociations());
|
||||||
boolean includeChildAssociations = (resultFilter == null ? true : resultFilter.getIncludeChildAssociations());
|
boolean includeChildAssociations = (resultFilter == null ? true : resultFilter.getIncludeChildAssociations());
|
||||||
boolean includeOwner = (resultFilter == null ? true : resultFilter.getIncludeOwner());
|
boolean includeOwner = (resultFilter == null ? true : resultFilter.getIncludeOwner());
|
||||||
|
boolean includeChildIds = (resultFilter == null ? true : resultFilter.getIncludeChildIds());
|
||||||
|
|
||||||
List<Long> nodeIds = preCacheNodes(nodeMetaDataParameters);
|
List<Long> nodeIds = preCacheNodes(nodeMetaDataParameters);
|
||||||
|
|
||||||
@@ -497,19 +498,18 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
|||||||
nodeMetaData.setNodeType(nodeType);
|
nodeMetaData.setNodeType(nodeType);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(includePaths || includeProperties)
|
if(includeProperties)
|
||||||
{
|
{
|
||||||
props = nodeDAO.getNodeProperties(nodeId);
|
props = nodeDAO.getNodeProperties(nodeId);
|
||||||
}
|
}
|
||||||
nodeMetaData.setProperties(props);
|
nodeMetaData.setProperties(props);
|
||||||
|
|
||||||
if(includePaths || includeAspects)
|
if(includeAspects)
|
||||||
{
|
{
|
||||||
aspects = nodeDAO.getNodeAspects(nodeId);
|
aspects = nodeDAO.getNodeAspects(nodeId);
|
||||||
}
|
}
|
||||||
nodeMetaData.setAspects(aspects);
|
nodeMetaData.setAspects(aspects);
|
||||||
|
|
||||||
// TODO paths may change during get i.e. node moved around in the graph
|
|
||||||
if(includePaths)
|
if(includePaths)
|
||||||
{
|
{
|
||||||
Collection<Pair<Path, QName>> categoryPaths = getCategoryPaths(pair.getSecond(), aspects, props);
|
Collection<Pair<Path, QName>> categoryPaths = getCategoryPaths(pair.getSecond(), aspects, props);
|
||||||
@@ -556,6 +556,33 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
|||||||
});
|
});
|
||||||
nodeMetaData.setChildAssocs(childAssocs);
|
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)
|
if(includeParentAssociations)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user