On a Mac server i.e. running Server.app it appears the server itself still does server-side Spotlight indexing. While there is no longer a tick box to enable/disable this per share on the server, when you do share a folder you can see a special ACL for the Spotlight process is added so it can have the access needed to index the contents of the folder and sub-folders. This should these days work for both AFP and SMB access to the Mac file server.
Windows Server itself has for a long time no longer had AFP support. However it is still possible to get Acronis Access formerly known as ExtremeZ-IP which adds AFP capabilities to a Windows Server and adds Spotlight indexing support as well.
See - https://kb.acronis.com/content/48794
Linux Servers use either Netatalk for providing AFP support, or SAMBA for providing SMB support. Both these have been enhanced to again include server-side Spotlight indexing. Sadly most but not all NAS servers even though they use Linux and Netatalk and/or SAMBA have not yet provided Spotlight support. I believe some Synology versions do now support Spotlight.
See - http://netatalk.sourceforge.net/wiki/index.php/Spotlight
See - https://wiki.samba.org/index.php/Spotlight