WIKI-282 Fix bug exception when searching in spaces