truncate incoming search queries (Fixes #328)