fix searches with spaces

This commit is contained in:
Zlatin Balevsky
2019-06-07 14:51:09 +01:00
parent d4336e9b5d
commit 114940c4c1
2 changed files with 2 additions and 3 deletions

View File

@@ -44,9 +44,7 @@ class SearchIndex {
if (rv == null) {
rv = forWord
} else {
System.out.println("before retention $rv")
rv.retainAll(forWord)
System.out.println("after retention")
}
}

View File

@@ -50,7 +50,8 @@ class MainFrameController {
searchEvent = new SearchEvent(searchHash : Base64.decode(search), uuid : uuid)
} else {
// this can be improved a lot
def terms = search.toLowerCase().trim().split(Constants.SPLIT_PATTERN)
def replaced = search.toLowerCase().trim().replaceAll(Constants.SPLIT_PATTERN, " ")
def terms = replaced.split(" ")
searchEvent = new SearchEvent(searchTerms : terms, uuid : uuid)
}
core.eventBus.publish(new QueryEvent(searchEvent : searchEvent, firstHop : true,