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

57092: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3)
      56577: Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1)
         56483: MNT-9629: Merged V4.1.5 (4.1.5.9) to V4.1-BUG-FIX (4.1.7)
            56479: MNT-9719 CLONE - User search does not return results with "<firstname> <lastname>" search in admin console users page.
               -  Addition of an Alfresco global property people.search.honor.hint.useCQ, which may be set to false to switch back to just using Solr or Lucene as it was in 4.1.1
                  rather than the canned query used by the Share User Console


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61721 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-11 19:28:38 +00:00
parent f4af8ae720
commit 144cae5c38
3 changed files with 26 additions and 1 deletions

View File

@@ -94,6 +94,7 @@ public class People extends BaseScopableProcessorExtension implements Initializi
private int numRetries = 10;
private int defaultListMaxResults = 5000;
private boolean honorHintUseCQ = true;
private static final String HINT_CQ_SUFFIX = " [hint:useCQ]";
@@ -243,6 +244,23 @@ public class People extends BaseScopableProcessorExtension implements Initializi
this.defaultListMaxResults = defaultListMaxResults;
}
/**
* Allows customers to choose to use Solr or Lucene rather than a canned query in
* {@link #getPeople(String, int, String, boolean)} when
* {@code " [hint:useCQ]"} is appended to the search term (currently Share's
* User Console does this). The down side is that new users may not appear as they
* will not have been indexed. This is similar to what happened in 4.1.1 prior to
* MNT-7548 (4.1.2 and 4.1.1.1). The down side of using a canned query at the moment
* is that there is a bug, so that it is impossible to search for names such as
* {@code "Carlos Allende García"} where the first or last names may contain spaces.
* See MNT-9719 for more details. The alfresco global property
* {@code people.search.honor.hint.useCQ} is used to set this value (default is true).
*/
public void setHonorHintUseCQ(boolean honorHintUseCQ)
{
this.honorHintUseCQ = honorHintUseCQ;
}
/**
* Delete a Person with the given username
*
@@ -563,7 +581,7 @@ public class People extends BaseScopableProcessorExtension implements Initializi
{
if (filter.endsWith(HINT_CQ_SUFFIX))
{
useCQ = true;
useCQ = honorHintUseCQ;
filter = filter.substring(0, filter.length()-HINT_CQ_SUFFIX.length());
}
}