mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Fix for SEARCH-222 SOLR 6 - Improved indexing for categories
- return ancestor based path for better support to internationalise categories etc (by UUID matching the public AIP) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@131769 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -274,21 +274,27 @@ public class NodesMetaDataGet extends DeclarativeWebScript
|
||||
this.txnId = nodeMetaData.getTxnId();
|
||||
|
||||
// convert Paths to Strings
|
||||
List<String> paths = new ArrayList<String>();
|
||||
List<String> paths = new ArrayList<String>();
|
||||
List<String> ancestorPaths = new ArrayList<String>();
|
||||
HashSet<String> ancestors = new HashSet<String>();
|
||||
if(nodeMetaData.getPaths() != null)
|
||||
{
|
||||
{
|
||||
StringBuilder ancestorPath = new StringBuilder();
|
||||
for(Pair<Path, QName> pair : nodeMetaData.getPaths())
|
||||
{
|
||||
JSONObject o = new JSONObject();
|
||||
o.put("path", solrSerializer.serializeValue(String.class, pair.getFirst()));
|
||||
o.put("qname", solrSerializer.serializeValue(String.class, pair.getSecond()));
|
||||
paths.add(o.toString(3));
|
||||
o.put("qname", solrSerializer.serializeValue(String.class, pair.getSecond()));
|
||||
|
||||
|
||||
for (NodeRef ancestor : getAncestors(pair.getFirst()))
|
||||
{
|
||||
ancestors.add(ancestor.toString());
|
||||
}
|
||||
ancestors.add(ancestor.toString());
|
||||
ancestorPath.insert(0, ancestor.getId()).insert(0, "/");
|
||||
}
|
||||
|
||||
o.put("apath", ancestorPath);
|
||||
paths.add(o.toString(3));
|
||||
}
|
||||
}
|
||||
this.ancestors = ancestors;
|
||||
|
Reference in New Issue
Block a user