RESTWS-267: Refactored SearchHandler
RESTWS-267: Added tests