Here is a link about Windows Search Code Samples you can use as a reference: Windows Search Code Samples.
And here is a link about how to enable the Windows Search service in Windows Server 2012: How to enable the Windows Search service in Windows Server 2012.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.