mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
svn merge -r 2570:2595 svn://www.alfresco.org/alfresco/BRANCHES/V1.2.0/root HEAD/root
svn merge -r 2597:2649 svn://www.alfresco.org/alfresco/BRANCHES/V1.2.0/root HEAD/root git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2650 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -119,6 +119,9 @@ public final class SearchContext implements Serializable
|
||||
/** any additional fixed value attributes to add to the search, such as boolean or noderef */
|
||||
private Map<QName, String> queryFixedValues = new HashMap<QName, String>(5, 1.0f);
|
||||
|
||||
/** set true to force the use of AND between text terms */
|
||||
private boolean forceAndTerms = false;
|
||||
|
||||
/** logger */
|
||||
private static Log logger = LogFactory.getLog(SearchContext.class);
|
||||
|
||||
@@ -217,6 +220,9 @@ public final class SearchContext implements Serializable
|
||||
term = term.substring(1);
|
||||
}
|
||||
|
||||
// special case for AND all terms if set (apply after operator character removed)
|
||||
operatorAND = operatorAND | this.forceAndTerms;
|
||||
|
||||
if (term.length() != 0)
|
||||
{
|
||||
// operators such as AND and OR are only make sense for full text searching
|
||||
@@ -654,6 +660,22 @@ public final class SearchContext implements Serializable
|
||||
return this.queryFixedValues.get(qname);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns if AND is forced between text terms. False (OR terms) is the default.
|
||||
*/
|
||||
public boolean getForceAndTerms()
|
||||
{
|
||||
return this.forceAndTerms;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param forceAndTerms Set true to force AND between text terms. Otherwise OR is the default.
|
||||
*/
|
||||
public void setForceAndTerms(boolean forceAndTerms)
|
||||
{
|
||||
this.forceAndTerms = forceAndTerms;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return this SearchContext as XML
|
||||
*
|
||||
|
Reference in New Issue
Block a user