🔍 Code Extractor

class ReportTopQueries

Maturity: 24

A specialized report class for retrieving top search queries from SharePoint Search REST API.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/reports/top_queries.py
Lines:
4 - 7
Complexity:
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

    A report class that identifies popular search queries with low click-through rates in SharePoint, helping to improve content discoverability and user satisfaction.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/reports/abandoned_queries.py
  • class ReportBase 63.1% similar

    ReportBase is a base class representing a report entity in Microsoft Office Server Search REST API, inheriting from ClientValue to provide client-side value representation.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/reports/base.py
  • class TopFilesSharingInsights 56.8% similar

    A SharePoint entity class representing insights about the most shared files in a tenant, providing access to file sharing analytics data.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/insights/top_files_sharing.py
  • class PromotedResultQueryRule 54.5% similar

    Represents a promoted result query rule in SharePoint Search, containing properties that describe promoted search results for a tenant, Search Service Application, or site collection.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/promoted_result_query_rule.py
  • class PromotedResultsOperationsResult 53.8% similar

    A data class representing the result of a REST API call to retrieve promoted search results from SharePoint/Office 365.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/promoted_results_operations_result.py
← Back to Browse