Hello there,
You can use the Microsoft Search API to index data. You can use Microsoft Graph to add custom items to search results in the Microsoft Search experience.
Use the Microsoft Search API to index data https://learn.microsoft.com/en-us/graph/api/resources/indexing-api-overview?view=graph-rest-1.0
Since you're having issues with searching files on your computer, we recommend that you rebuild the Windows Search index and check if the issue persists. You may refer to the steps below to verify indexed locations:
Go to Control Panel.
Find the section labeled Indexing Options.
In the Indexing Options window, make sure that Windows is indexing the location of your files.
Click the Modify button to see the list of all locations on your computer.
Find the folder that contains the files that you will index.
Check the box.
Click OK.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer–