From 26af16e331839a185378ccad8e33232e30d9914c Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Fri, 27 Apr 2012 13:51:52 +0000 Subject: [PATCH] Merged BRANCHES/DEV/V4.0-BUG-FIX to HEAD 35833: Fix for ALF-13881 - Unable to search against custom properties or any props requiring other than cm: namespace default in Share Person Search git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@35834 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/repo/jscript/People.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/java/org/alfresco/repo/jscript/People.java b/source/java/org/alfresco/repo/jscript/People.java index f00e9fbe47..c9b9ca21af 100644 --- a/source/java/org/alfresco/repo/jscript/People.java +++ b/source/java/org/alfresco/repo/jscript/People.java @@ -533,7 +533,7 @@ public final class People extends BaseScopableProcessorExtension implements Init { String term = filter.replace("\\", "").replace("\"", ""); StringTokenizer t = new StringTokenizer(term, " "); - int propIndex = term.indexOf(':'); + int propIndex = term.lastIndexOf(':'); int wildPosition = term.indexOf('*'); if ((t.countTokens() == 1) && (propIndex == -1) && ((wildPosition == -1) || (wildPosition == (term.length() - 1) ))) @@ -568,18 +568,18 @@ public final class People extends BaseScopableProcessorExtension implements Init if (t.countTokens() == 1) { // single word with no field will go against _PERSON and expand - + // fts-alfresco property search i.e. location:"maidenhead" query.append(term.substring(0, propIndex+1)) .append('"') .append(term.substring(propIndex+1)); - if(propIndex > 0) + if (propIndex > 0) { query.append('"'); } else { - query.append("*\""); + query.append("*\""); } } else @@ -638,7 +638,7 @@ public final class People extends BaseScopableProcessorExtension implements Init else { // fts-alfresco property search i.e. "location:maidenhead" - propIndex = term.indexOf(':'); + propIndex = term.lastIndexOf(':'); query.append(term.substring(0, propIndex+1)) .append('"') .append(term.substring(propIndex+1))