🔍 Code Extractor

class SearchSetting

Maturity: 33

This object provides the REST operations defined under search settings.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/setting.py
Lines:
12 - 118
Complexity:
moderate

Purpose

This object provides the REST operations defined under search settings.

Source Code

class SearchSetting(Entity):
    """This object provides the REST operations defined under search settings."""

    def __init__(self, context):
        super(SearchSetting, self).__init__(
            context, ResourcePath("Microsoft.Office.Server.Search.REST.SearchSetting")
        )

    def get_query_configuration(
        self,
        call_local_search_farms_only=True,
        skip_group_object_id_lookup=None,
        throw_on_remote_api_check=None,
    ):
        """
        This operation gets the query configuration from the server. This operation requires that the Search Service
        Application is partitioned. If the Search Service Application is not partitioned the operations returns
        HTTP code 400, not authorized.

        :param bool call_local_search_farms_only: This is a flag that indicates to only call the local search farm.
        :param bool skip_group_object_id_lookup:
        :param bool throw_on_remote_api_check:
        """
        return_type = ClientResult(self.context, QueryConfiguration())
        payload = {
            "callLocalSearchFarmsOnly": call_local_search_farms_only,
            "skipGroupObjectIdLookup": skip_group_object_id_lookup,
            "throwOnRemoteApiCheck": throw_on_remote_api_check,
        }
        qry = ServiceOperationQuery(
            self, "getqueryconfiguration", None, payload, None, return_type
        )
        self.context.add_query(qry)
        return return_type

    def export_search_reports(
        self,
        tenant_id,
        report_type=None,
        interval=None,
        start_date=None,
        end_date=None,
        site_collection_id=None,
    ):
        """
        :param str tenant_id:
        :param str report_type:
        :param str interval:
        :param str start_date:
        :param str end_date:
        :param str site_collection_id:
        """
        return_type = ClientResult(self.context, ReportBase())
        payload = {
            "TenantId": tenant_id,
            "ReportType": report_type,
            "Interval": interval,
            "StartDate": start_date,
            "EndDate": end_date,
            "SiteCollectionId": site_collection_id,
        }
        qry = ServiceOperationQuery(
            self, "ExportSearchReports", None, payload, None, return_type
        )
        self.context.add_query(qry)
        return return_type

    def ping_admin_endpoint(self):
        """ """
        return_type = ClientResult[bool](self.context)
        qry = ServiceOperationQuery(
            self, "PingAdminEndpoint", None, None, None, return_type
        )
        self.context.add_query(qry)
        return return_type

    def get_promoted_result_query_rules(
        self, site_collection_level=None, offset=None, number_of_rules=None
    ):
        """
        The operation is called to retrieve the promoted results (also called Best Bets) for a tenant or a
        site collection.

        :param bool site_collection_level: This parameter is used by the protocol server to decide which promoted
           results to return to the client. If the parameter is true, the promoted results for the current
           site collection are returned. If the parameter is false, all promoted results for the
           tenant/Search Service Application are returned.
        :param int offset: This parameter is the offset into the collection of promoted results. Default value is zero.
           It is used to page through a large result set.
        :param int number_of_rules: his parameter is the number of promoted results that are returned in the operation.
            Default value is 100. It is used together with the offset to page through a large result set.
        """
        return_type = ClientResult(self.context, PromotedResultsOperationsResult())
        payload = {
            "siteCollectionLevel": site_collection_level,
            "offset": offset,
            "numberOfRules": number_of_rules,
        }
        qry = ServiceOperationQuery(
            self, "getpromotedresultqueryrules", None, payload, None, return_type
        )
        self.context.add_query(qry)
        return return_type

    @property
    def entity_type_name(self):
        return "Microsoft.Office.Server.Search.REST.SearchSetting"

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

bases: Parameter of type Entity

Return Value

Returns unspecified type

Class Interface

Methods

__init__(self, context)

Purpose: Internal method: init

Parameters:

  • context: Parameter

Returns: None

get_query_configuration(self, call_local_search_farms_only, skip_group_object_id_lookup, throw_on_remote_api_check)

Purpose: This operation gets the query configuration from the server. This operation requires that the Search Service Application is partitioned. If the Search Service Application is not partitioned the operations returns HTTP code 400, not authorized. :param bool call_local_search_farms_only: This is a flag that indicates to only call the local search farm. :param bool skip_group_object_id_lookup: :param bool throw_on_remote_api_check:

Parameters:

  • call_local_search_farms_only: Parameter
  • skip_group_object_id_lookup: Parameter
  • throw_on_remote_api_check: Parameter

Returns: See docstring for return details

export_search_reports(self, tenant_id, report_type, interval, start_date, end_date, site_collection_id)

Purpose: :param str tenant_id: :param str report_type: :param str interval: :param str start_date: :param str end_date: :param str site_collection_id:

Parameters:

  • tenant_id: Parameter
  • report_type: Parameter
  • interval: Parameter
  • start_date: Parameter
  • end_date: Parameter
  • site_collection_id: Parameter

Returns: None

ping_admin_endpoint(self)

Purpose: Performs ping admin endpoint

Returns: None

get_promoted_result_query_rules(self, site_collection_level, offset, number_of_rules)

Purpose: The operation is called to retrieve the promoted results (also called Best Bets) for a tenant or a site collection. :param bool site_collection_level: This parameter is used by the protocol server to decide which promoted results to return to the client. If the parameter is true, the promoted results for the current site collection are returned. If the parameter is false, all promoted results for the tenant/Search Service Application are returned. :param int offset: This parameter is the offset into the collection of promoted results. Default value is zero. It is used to page through a large result set. :param int number_of_rules: his parameter is the number of promoted results that are returned in the operation. Default value is 100. It is used together with the offset to page through a large result set.

Parameters:

  • site_collection_level: Parameter
  • offset: Parameter
  • number_of_rules: Parameter

Returns: See docstring for return details

entity_type_name(self) property

Purpose: Performs entity type name

Returns: None

Required Imports

from office365.runtime.client_result import ClientResult
from office365.runtime.paths.resource_path import ResourcePath
from office365.runtime.queries.service_operation import ServiceOperationQuery
from office365.sharepoint.entity import Entity
from office365.sharepoint.search.promoted_results_operations_result import PromotedResultsOperationsResult

Usage Example

# Example usage:
# result = SearchSetting(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SearchSettings 65.0% similar

    A class that collects and manages all configurable settings related to search operations over connector content in Office 365.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/search/external/search_settings.py
  • class ObjectSharingSettings 54.2% similar

    This class contains the information necessary to read and change the sharing status of a SharePoint object. It also contains a reference to SharePoint specific settings denoted by "SharePointSettings".

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/object_sharing_settings.py
  • class UserSettings 53.8% similar

    A class representing user settings for content discovery in Microsoft Teams, specifically managing shift preferences for scheduling.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/users/settings.py
  • class RegionalSettings 50.9% similar

    Represents regional settings that are used on the server that is running SharePoint Server.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/webs/regional_settings.py
  • class SearchEndpoints 50.8% similar

    A class representing SharePoint search endpoints configuration, containing admin endpoint and query context for search operations.

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