class ReportTopQueries
A specialized report class for retrieving top search queries from SharePoint Search REST API.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/reports/top_queries.py
4 - 7
simple
Purpose
ReportTopQueries is a concrete implementation of ReportBase that represents a report for top search queries in SharePoint. It provides the entity type name required for REST API communication with SharePoint Search services to retrieve analytics about the most frequently executed search queries. This class is part of the SharePoint Search reporting framework and is used to fetch query analytics data.
Source Code
class ReportTopQueries(ReportBase):
@property
def entity_type_name(self):
return "Microsoft.Office.Server.Search.REST.ReportTopQueries"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ReportBase | - |
Parameter Details
__init__: Inherits constructor from ReportBase. The exact parameters depend on the parent class implementation, but typically would include context or connection information for SharePoint API communication.
Return Value
Instantiation returns a ReportTopQueries object that can be used to interact with SharePoint Search REST API for top queries reporting. The entity_type_name property returns a string 'Microsoft.Office.Server.Search.REST.ReportTopQueries' which is used internally for API communication.
Class Interface
Methods
@property entity_type_name(self) -> str
property
Purpose: Returns the fully qualified entity type name used by SharePoint Search REST API to identify this report type
Returns: String value 'Microsoft.Office.Server.Search.REST.ReportTopQueries' which identifies this report type in the SharePoint Search REST API
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
entity_type_name |
str | Read-only property that returns the SharePoint REST API entity type identifier for top queries reports | instance |
Dependencies
office365
Required Imports
from office365.sharepoint.search.reports.base import ReportBase
from office365.sharepoint.search.reports.top_queries import ReportTopQueries
Usage Example
from office365.sharepoint.search.reports.top_queries import ReportTopQueries
from office365.runtime.auth.client_credential import ClientCredential
from office365.sharepoint.client_context import ClientContext
# Setup SharePoint context
site_url = 'https://yourtenant.sharepoint.com/sites/yoursite'
credentials = ClientCredential('client_id', 'client_secret')
ctx = ClientContext(site_url).with_credentials(credentials)
# Create report instance (exact instantiation depends on ReportBase implementation)
report = ReportTopQueries(ctx)
# The entity_type_name property is used internally by the framework
entity_type = report.entity_type_name
print(entity_type) # Output: Microsoft.Office.Server.Search.REST.ReportTopQueries
# Execute report query (method names depend on ReportBase implementation)
# report.execute_query()
# results = report.get_results()
Best Practices
- This class should be instantiated through the proper SharePoint context and authentication mechanism provided by the office365 library
- The entity_type_name property is primarily for internal use by the REST API framework and should not typically be modified
- Ensure proper authentication and permissions are configured before attempting to retrieve search analytics data
- This class follows the inheritance pattern from ReportBase, so understanding the parent class methods is essential for proper usage
- The class is designed to work within the office365-python-client library ecosystem and should be used in conjunction with ClientContext
- Always handle potential API errors and authentication failures when working with SharePoint REST services
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ReportAbandonedQueries 67.9% similar
-
class ReportBase 63.1% similar
-
class TopFilesSharingInsights 56.8% similar
-
class PromotedResultQueryRule 54.5% similar
-
class PromotedResultsOperationsResult 53.8% similar