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:
Derek Hulley
2006-04-12 14:58:21 +00:00
parent 0d45ce4c18
commit c88e18b6b7
9 changed files with 121 additions and 6 deletions

View File

@@ -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
*