BZ-1072434: trim filter in order to discard spaces (begin/end) during search