Make CompiledSearchQuery a class for serialization