prevent empty tokens in search index

This commit is contained in:
Zlatin Balevsky
2019-06-20 16:02:48 +01:00
parent f1ac038b55
commit 1d41bcd825

View File

@ -34,6 +34,9 @@ class SearchIndex {
private static String[] split(String source) {
source = source.replaceAll(Constants.SPLIT_PATTERN, " ").toLowerCase()
source.split(" ")
def rv = []
source.each { if (it.length() > 0) rv << it }
rv.toArray(new String[0])
}
String[] search(List<String> terms) {