Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)

125032 jvonka: RA-767: Queries API - bug fixes (and updated tests)
   - optional rootNodeId should allow well-known aliases (-root-,-my-,-shared-)
   - investigate and 'fix' apparent underlying issue with '.' which causes 500 in FTS query parser, eg. abc.txt


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126608 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-05-10 11:49:46 +00:00
parent da10a84d50
commit cbc53527ee
4 changed files with 58 additions and 14 deletions

View File

@@ -158,11 +158,12 @@ public class QueriesImpl implements Queries, InitializingBean
String rootNodeId = parameters.getParameter(PARAM_ROOT_NODE_ID);
if (rootNodeId != null)
{
sb.append("PATH:\"").append(getQNamePath(rootNodeId)).append("//*\" AND (");
NodeRef nodeRef = nodes.validateOrLookupNode(rootNodeId, null);
sb.append("PATH:\"").append(getQNamePath(nodeRef.getId())).append("//*\" AND (");
}
// this will be expanded via query template
sb.append(QT_FIELD+":").append(term);
// this will be expanded via query template (+ default field name)
sb.append(term);
if (rootNodeId != null)
{
@@ -195,8 +196,9 @@ public class QueriesImpl implements Queries, InitializingBean
sp.setQuery(sb.toString());
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
// query template / field
// query template / default field name
sp.addQueryTemplate(QT_FIELD, "%(cm:name cm:title cm:description TEXT TAG)");
sp.setDefaultFieldName(QT_FIELD);
Paging paging = parameters.getPaging();
PagingRequest pagingRequest = Util.getPagingRequest(paging);