This article shows how to re-index a Document Library or Custom List in SharePoint Online.
Here I have explained everything. Whenever we encounter a problem related to Search in SharePoint Online or after searching an item it does not return a result then we must use the following procedure.
Getting Started with SharePoint Framework Development using TypeScript, PnP JS, and React JS