Merged V2.1 to HEAD

8059: Fix for AWC-1743 - generated phrase searches no longer escape values between the quotes

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8478 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-03-10 15:00:42 +00:00
parent 2133375d89
commit 8387ca03f0

View File

@@ -200,7 +200,7 @@ public class SearchContext implements Serializable
if (text.charAt(0) == '"' && text.charAt(text.length() - 1) == '"')
{
// as a single quoted phrase
String quotedSafeText = '"' + QueryParser.escape(text.substring(1, text.length() - 1)) + '"';
String quotedSafeText = '"' + text.substring(1, text.length() - 1) + '"';
fullTextBuf.append("TEXT:").append(quotedSafeText);
nameAttrBuf.append("@").append(nameAttr).append(":").append(quotedSafeText);
for (QName qname : this.simpleSearchAdditionalAttrs)
@@ -512,11 +512,10 @@ public class SearchContext implements Serializable
else
{
// phrase multi-word search
String safeValue = QueryParser.escape(value);
if (andOp) buf.append('+');
else if (notOp) buf.append('-');
buf.append('@').append(Repository.escapeQName(qname)).append(":\"")
.append(safeValue).append('"').append(' ');
.append(value).append('"').append(' ');
}
}