mirror of https://github.com/zlatinb/muwire
prevent empty tokens in search index
parent
f1ac038b55
commit
1d41bcd825
|
@ -34,6 +34,9 @@ class SearchIndex {
|
||||||
private static String[] split(String source) {
|
private static String[] split(String source) {
|
||||||
source = source.replaceAll(Constants.SPLIT_PATTERN, " ").toLowerCase()
|
source = source.replaceAll(Constants.SPLIT_PATTERN, " ").toLowerCase()
|
||||||
source.split(" ")
|
source.split(" ")
|
||||||
|
def rv = []
|
||||||
|
source.each { if (it.length() > 0) rv << it }
|
||||||
|
rv.toArray(new String[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] search(List<String> terms) {
|
String[] search(List<String> terms) {
|
||||||
|
|
Loading…
Reference in New Issue