Merged V3.4 to HEAD

24322: Fix for ALF-5311 - People search by properties is not handling tokenized fields correctly
   24407: Merged V3.3 to V3.4
             24406: Merged PATCHES/V3.3.4 to V3.3
                24405: Fix for ALF-6098 - links display issue encoding link url
   24706: Merged V3.4-BUG-FIX to V3.4
            24705: Fix for ALF-6365, ALF-6335
   24709: Missing first/last name handling.
   24711: Merged V3.3 to V3.4
            24710: ALF-5535 - Fix to correctly format json number values (not as numeric human readable strings)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@24871 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2011-01-17 10:01:29 +00:00
parent 338c43af0c
commit 95cdff81f5

View File

@@ -510,7 +510,8 @@ public final class People extends BaseScopableProcessorExtension implements Init
StringTokenizer t = new StringTokenizer(term, " ");
if (t.countTokens() == 1)
{
if (term.indexOf(':') == -1)
int propIndex = term.indexOf(':');
if (propIndex == -1)
{
// simple search: first name, last name and username starting with term
query.append("firstName:\"");
@@ -523,8 +524,11 @@ public final class People extends BaseScopableProcessorExtension implements Init
}
else
{
// fts-alfresco property search i.e. "location:maidenhead"
query.append(term);
// fts-alfresco property search i.e. location:"maidenhead"
query.append(term.substring(0, propIndex+1))
.append('"')
.append(term.substring(propIndex+1))
.append('"');
}
}
else
@@ -587,7 +591,11 @@ public final class People extends BaseScopableProcessorExtension implements Init
else
{
// fts-alfresco property search i.e. "location:maidenhead"
query.append(term);
int propIndex = term.indexOf(':');
query.append(term.substring(0, propIndex+1))
.append('"')
.append(term.substring(propIndex+1))
.append('"');
propertySearch = true;
}