Microsoft Search Items
About
Microsoft Search OneDrive search engine uses the Graph APIto:
- Send search queries to Microsoft 365
- Receive files stored in SharePoint or OneDrive
- Query the following resource types, which are configured at the backend level:
- driveItem
- list
- listItem
- site
- externalItem
Set Azure Active Directory Authentication
You can set your authentication to Azure Active Directory in SmartHub as described here: Azure Active Directory Authentication.
Application Permissions
The Client ID specified in Azure Active Directory Authentication must belong to an application with the following permissions:
- Microsoft Graph
- Files.Read.All
- Sites.Read.All
How to Add the Microsoft Search Items search engine to SmartHub
Use the following instructions to add the Microsoft Search Drive Items backend to SmartHub:
- Navigate to the SmartHub Administration page: http(s)://[web-app-url]/_admin
- Click Add New Backend. The Search Engine dialogue box appears.
- Type: Select Regular.
- Search Engine: Select MS Search Items from the drop-down list.
- Name: Enter a name for your search engine.
- Entity Types: Select any of the following entity types that you want to query for:
- driveItem
- list
- listItem
- site
- externalItem
- Connector Connection Id(only for external item): Enter the connection ID associated with your content.
- To get the connector Connection ID, do the following:
- Go to the Office Admin page.
- Click Settings > Microsoft Search.
- Click Connectors. A list of your current connectors appears with their connection IDs.
- The connection ID value is the parameter the search engine expects to receive.
- To get the connector Connection ID, do the following:
- Graph Url: This is the URL of your Microsoft Graph instance. For example, https://graph.microsoft.com/.
- Authentication Select whether to enable or disable Impersonate authentication:
- Impersonate enabled
- Security trims the results using the current user running the search
- Impersonate disabled
- Client Id: Enter the Application ID from Azure App Registrations.
- Client Secret: Enter the Key's value from Azure App Registrations.
- Microsoft Login Endpoint: Example: https://login.microsoftonline.com
- Access Token: Enter the access token from SmartHub's OAuth page.
- Refresh Token: Enter the refresh token from SmartHub's OAuth page.
- Impersonate enabled
Note: To get the Access and Refresh tokens, the "Authorize" button must be clicked, but all the above fields must be completed (GraphUrl, ClientId, ClientSecret, MicrosoftLoginEndpoint).
8. Click OK.
How to Register an App in Azure and Configure It
If you use SmartHub with Azure Active Directory authentication, you can reuse the same App and jump to step 5. To register and configure an app in Azure, do the following:
- Navigate to portal.azure.comand log in.
- From the left side menu go to Azure Active Directory → App registrations → New registration
- Name: Enter the name of the application.
- Application type: Select Web app / API.
- Sign-on URL: Enter the SmartHub's URL.
- Select API Permissions to open the settings menu panel.
- Click Add a Permission.
- Select APIs my organization uses and add the following permissions (as you type the name, it appears):
- Microsoft Graph
- Files.Read.All or Sites.Read.All
- Files.Read.All or Sites.Read.All
- Microsoft Graph
- Click Certificates & secrets>New client secret to generate a client secret key.
- In the window that appears (shown below) enter the following information.
- Description: Enter a name for the client secret. (Note: The name is your client secret).
- Expires: Select the period until expires
- A Value is generated after you click Add.
Metadata
The following metadata is available for your results:
- rank
- summary
- @odata.type
- lastModifiedDateTime
- createdDateTime
- webUrl
- createdBy
- name
- size
- lastModifiedBy
Note: For some types, not all metadata is available
Limitations
Note the following limitations when using the Microsoft Search OneDrive search engine:
-
Date refiners are not supported.
-
Result sorting is not supported for external items.