Search action is used to find something in combat. That's it. It may be a trap, it may be a hiding creature, it may be pretty much anything. It doesn't need to be only Perception check either: using Investigation to identify illusions could also be interpreted as being Search action. It's also not just visual... attempting to find the location of a hidden, invisible creature would also fall under Search.

RAW, you must use your action (or BA) to Hide if you want to use Stealth in combat. Merely breaking line of sight isn't enough.