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:
Andrew Hind
2016-10-26 08:51:01 +00:00
parent 342fe3fd70
commit a5c81061e5
2 changed files with 22 additions and 4 deletions
@@ -56,7 +56,8 @@ public class NodeMetaData
private String owner;
private long txnId;
private Set<NodeRef> ancestors;
private String tenantDomain;
private String tenantDomain;
private List<String> ancestorPaths;
public long getId()
{
@@ -117,6 +118,16 @@ public class NodeMetaData
public void setPaths(List<Pair<String, QName>> paths)
{
this.paths = paths;
}
public List<String> getAncestorPaths()
{
return ancestorPaths;
}
public void setAncestorPaths(List<String> ancestorPaths)
{
this.ancestorPaths = ancestorPaths;
}
public List<List<String>> getNamePaths()
@@ -939,15 +939,22 @@ public class SOLRAPIClient
if(jsonNodeInfo.has("paths"))
{
JSONArray jsonPaths = jsonNodeInfo.getJSONArray("paths");
List<Pair<String, QName>> paths = new ArrayList<Pair<String, QName>>(jsonPaths.length());
List<Pair<String, QName>> paths = new ArrayList<Pair<String, QName>>(jsonPaths.length());
List<String> ancestorPaths = new ArrayList<String>();
for(int j = 0; j < jsonPaths.length(); j++)
{
JSONObject path = jsonPaths.getJSONObject(j);
String pathValue = path.getString("path");
QName qname = path.has("qname") ? deserializer.deserializeValue(QName.class, path.getString("qname")) : null;
paths.add(new Pair<String, QName>(pathValue, qname));
paths.add(new Pair<String, QName>(pathValue, qname));
if(path.has("apath"))
{
String ancestorPath = path.getString("apath");
ancestorPaths.add(ancestorPath);
}
}
metaData.setPaths(paths);
metaData.setPaths(paths);
metaData.setAncestorPaths(ancestorPaths);
}
if(jsonNodeInfo.has("namePaths"))