If the search begins with non-word characters, the array returned by join() will have as its first element. We don't want in the array. So lo, we remove it.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2239 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
zell
2007-10-15 18:33:21 +00:00
parent b602999a8b
commit 0648698b24
@@ -47,6 +47,7 @@ import com.samskivert.jdbc.depot.FieldMarshaller.ObjectMarshaller;
import com.samskivert.jdbc.depot.FieldMarshaller.ShortMarshaller;
import com.samskivert.jdbc.depot.annotation.FullTextIndex;
import com.samskivert.jdbc.depot.operator.Conditionals.FullTextMatch;
import com.samskivert.util.ArrayUtil;
import com.samskivert.util.StringUtil;
import com.samskivert.Log;
@@ -88,6 +89,9 @@ public class PostgreSQLBuilder
// 'ho! who goes there?' -> 'ho|who|goes|there'
String[] searchTerms = match.getQuery().toLowerCase().split("\\W+");
if (searchTerms.length > 0 && searchTerms[0].length() == 0) {
searchTerms = ArrayUtil.splice(searchTerms, 0, 1);
}
String query = StringUtil.join(searchTerms, "|");
_stmt.setString(_argIdx ++, query);
}