Added workaround for short chat search keywords

This commit is contained in:
Robin Kupper
2011-08-20 22:17:18 +02:00
parent 939c98c90b
commit 0412191d6d

View File

@@ -169,7 +169,10 @@ public class QueryParams implements Cloneable
final StringBuilder where = new StringBuilder("WHERE ");
if (blockChangeType == BlockChangeType.CHAT) {
if (match != null && match.length() > 0)
where.append("MATCH (message) AGAINST ('" + match + "' IN BOOLEAN MODE) AND ");
if (match.length() > 3)
where.append("MATCH (message) AGAINST ('" + match + "' IN BOOLEAN MODE) AND ");
else
where.append("message LIKE '%" + match + "%' AND ");
} else {
switch (blockChangeType) {
case ALL: