If your organization is toying with the idea of SharePoint Online for file storage, the built in Modern search capabilities alone should seal the deal. Modern search is nothing like Windows Explorer search and migrating to SharePoint Online can drastically improve the employee experience. But, if users are new to the cloud based environment they are most likely new to documents opening in the Browser. This is the default behavior for SharePoint Online but not the only option. So before migrating files, some education is needed on the two methods for file opening: browser and application.
1.Open in the Browser – this means the file will render in the web browser. Depending on the users’ level of access, the file will open in either View or Edit mode.

2.Open in Application – this means the file will render in the client application, in this case Microsoft Word. Depending on the users’ level of access, the file will open in either View or Edit mode.

How does SharePoint Online decide to open the file? The default behavior is to open in the browser but there are two places to override this and force files to open in their client application: site collection features and document library level.
1.Site Collection Features – browse to Site Settings -> Site Collection Administration -> Site Collection Features. By activating the ‘Open Documents in Client Applications by Default’, you will force files to open in their native client.

2.Document Library – browse to Site Settings -> Library Settings -> Advanced Settings -> Opening Documents in the Browser. Here you can change the setting to ‘Open in the clients application’.

Now, bringing this back around to the modern search conversation, when a user searches for a document in SharePoint Online, the search results do not follow the same rules set for the site collection and/or document library levels. For example, if you have your library defaulted to ‘Open in Application’, clicked on search results will open in the browser. To clear this up, it’s important to help users understand where they’re searching so they know the expected behavior.
First, check the context of the search box at the top of the screen. The hint text will spell out the search scope . On a site homepage it will read “Search this site” or “Search in SharePoint”.


If it’s a Hub Site, it will read “Search across sites”.

In a library it will read “Search this library”.

In all instances, if you click inside of the search box, you will be presented with some suggestions before you type anything. Your most relevant suggestions are presented at the top of the order.
When you search a site – your results will return on a different page. When you click on these results, they will open in the browser.

When you search a library – you’re essentially filtering the records so it will return the same page. When you click on these results, they will follow the default behavior specified in the settings.

More questions and points that you may encounter:
Q: When I search for a document and click on it from my search results page, can it open in a new tab?
A: Yes, this is standard behavior. If for some reason your document opens in the same tab, right click the link and select ‘Open in New Tab’. Or, hold down the Ctrl key and click the link to open in a new tab.
Q: When I search for a document and click on it from my search results page, it always opens in the browser. Can I open it in the application by default?
A: By default, documents clicked on from the search results page will open in the browser. Even if you have settings enabled to open your documents in the application on source library and/or site collection, the search results will always open in the browser. This can be a problem for Excel documents with controls that are not Browser supported.
Workaround: On the search results page, click on the ellipsis at the top right of the image preview. Here you will find additional options to open the file.

Q: What about PDF?
A. When you click the ellipses for PDF, you do not see the options for Open in Browser or Open in App. Click on the PDF to open it in SharePoint then under the Open button, there’s an option to Open in browser.

If you’re interested in a custom web part solution, there are resources on GitHub for PnP Modern Search. Caution – this would require searching in the custom web part, not the OOTB search boxes, so there would be some communication/training involved in this solution.