I use Apples Spotlight all the time. The shortcut CMD + Spacebar is so convenient that I use it exclusively to open apps, do currency conversion or simple calculations. Recently, though, Xcode disappeared from the Spotlight search. Actually at the moment it happens each time there is an Xcode update. After a short search, I found a solution to this problem. Simply re-activate the spotlight indexing by entering the following command in the terminal:

sudo mdutil -i on /

Simple yet effective, I can now continue to use my beloved Spotlight to open my apps. I hope this little tip might save you one day from having a bad time. Cheers ✌️