Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

107010: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud)
      106860: MNT-14113: User admin console: sorting users causes some to disappear
      The behavior of indexed people search has been modified to return the same results as a CQ search. The test for this behavior has been added to 'PeolpleTest'. This test is valid for SOLR1/SOLR4 and "buildonly" (Lucene)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@107049 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-06-25 08:28:15 +00:00
parent 11ad4a1073
commit 1eda74e709
2 changed files with 46 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2013 Alfresco Software Limited.
* Copyright (C) 2005-2015 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -27,7 +27,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.authentication.AuthenticationException;
@@ -718,8 +717,12 @@ public class People extends BaseScopableProcessorExtension implements Initializi
// 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));
query.append(term.substring(0, propIndex + 1)).append('"');
if (propIndex < 0)
{
query.append('*');
}
query.append(term.substring(propIndex + 1));
if (propIndex > 0)
{
query.append('"');
@@ -753,7 +756,7 @@ public class People extends BaseScopableProcessorExtension implements Initializi
{
// simple search: first name, last name and username
// starting with term
query.append("_PERSON:\"");
query.append("_PERSON:\"*");
query.append(token);
query.append("*\" ");
}
@@ -766,7 +769,7 @@ public class People extends BaseScopableProcessorExtension implements Initializi
{
token = token.substring(0, token.lastIndexOf("*"));
}
multiPartNames.append("\"");
multiPartNames.append("\"*");
multiPartNames.append(token);
multiPartNames.append("*\"");
if (firstToken)