mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM: Support query for empty strings against untokenised text properties
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16622 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -932,7 +932,7 @@ public class LuceneQueryParser extends QueryParser
|
|||||||
String localeString = null;
|
String localeString = null;
|
||||||
if (field.startsWith("@"))
|
if (field.startsWith("@"))
|
||||||
{
|
{
|
||||||
if (queryText.charAt(0) == '\u0000')
|
if ((queryText.length() > 0) && (queryText.charAt(0) == '\u0000'))
|
||||||
{
|
{
|
||||||
int position = queryText.indexOf("\u0000", 1);
|
int position = queryText.indexOf("\u0000", 1);
|
||||||
testText = queryText.substring(position + 1);
|
testText = queryText.substring(position + 1);
|
||||||
@@ -1299,6 +1299,8 @@ public class LuceneQueryParser extends QueryParser
|
|||||||
if (replace != null)
|
if (replace != null)
|
||||||
{
|
{
|
||||||
StringBuilder postfix = new StringBuilder();
|
StringBuilder postfix = new StringBuilder();
|
||||||
|
if ((replace.endOffset() >= 0) && (replace.endOffset() < testText.length()))
|
||||||
|
{
|
||||||
for (int i = replace.endOffset(); i < testText.length(); i++)
|
for (int i = replace.endOffset(); i < testText.length(); i++)
|
||||||
{
|
{
|
||||||
char test = testText.charAt(i);
|
char test = testText.charAt(i);
|
||||||
@@ -1311,6 +1313,7 @@ public class LuceneQueryParser extends QueryParser
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
String post = postfix.toString();
|
String post = postfix.toString();
|
||||||
int oldPositionIncrement = replace.getPositionIncrement();
|
int oldPositionIncrement = replace.getPositionIncrement();
|
||||||
String replaceTermText = new String(replace.termBuffer(), 0, replace.termLength());
|
String replaceTermText = new String(replace.termBuffer(), 0, replace.termLength());
|
||||||
|
Reference in New Issue
Block a user