Implemented search with query limits