🔍 Code Extractor

class RelevantResults

Maturity: 36

The RelevantResults table contains the actual query results. It MUST only be present if the ResultTypes element in the properties element of the Execute message contains ResultType.RelevantResults, as specified in section 2.2.5.5

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/relevant_results.py
Lines:
6 - 62
Complexity:
moderate

Purpose

The RelevantResults table contains the actual query results. It MUST only be present if the ResultTypes element in the properties element of the Execute message contains ResultType.RelevantResults, as specified in section 2.2.5.5

Source Code

class RelevantResults(ClientValue):
    """
    The RelevantResults table contains the actual query results. It MUST only be present if the ResultTypes element
    in the properties element of the Execute message contains ResultType.RelevantResults,
    as specified in section 2.2.5.5
    """

    def __init__(
        self,
        group_template_id=None,
        item_template_id=None,
        properties=None,
        result_title=None,
        result_title_url=None,
        table=SimpleDataTable(),
        row_count=None,
        total_rows=None,
        total_rows_including_duplicates=None,
    ):
        """
        :param str item_template_id: Specifies the identifier of the layout template that specifies how the result
            item will be displayed.
        :param str group_template_id: Specifies the identifier of the layout template that specifies how the results
            returned will be arranged.
        :param dict properties: Specifies a property bag of key value pairs
        :param str result_title: Specifies the title associated with results for the transformed query by query rule
            action. MUST NOT be more than 64 characters in length.
        :param str result_title_url: Specifies the URL to be linked to the ResultTitle. MUST NOT be more than 2048
            characters in length
        :param SimpleDataTable table: This contains a table of query results
        :param int row_count: The number of query results contained in the Table element.
        :param int total_rows: This element MUST contain the total number of results that match the conditions given
             in the search query and are of the type specified in the ResultType element.
        :param int total_rows_including_duplicates:  This element SHOULD contain the total number of results,
            including duplicates, that match the conditions given in the search query and are of the type specified
            in the ResultType element
        """
        super(RelevantResults, self).__init__()
        self.GroupTemplateId = group_template_id
        self.ItemTemplateId = item_template_id
        self.Properties = properties
        self.ResultTitle = result_title
        self.ResultTitleUrl = result_title_url
        self.RowCount = row_count
        self.Table = table
        self.TotalRows = total_rows
        self.TotalRowsIncludingDuplicates = total_rows_including_duplicates

    def set_property(self, k, v, persist_changes=True):
        if k == "Properties":
            v = ODataType.parse_key_value_collection(v)
        super(RelevantResults, self).set_property(k, v, persist_changes)
        return self

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

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

bases: Parameter of type ClientValue

Return Value

Returns unspecified type

Class Interface

Methods

__init__(self, group_template_id, item_template_id, properties, result_title, result_title_url, table, row_count, total_rows, total_rows_including_duplicates)

Purpose: :param str item_template_id: Specifies the identifier of the layout template that specifies how the result item will be displayed. :param str group_template_id: Specifies the identifier of the layout template that specifies how the results returned will be arranged. :param dict properties: Specifies a property bag of key value pairs :param str result_title: Specifies the title associated with results for the transformed query by query rule action. MUST NOT be more than 64 characters in length. :param str result_title_url: Specifies the URL to be linked to the ResultTitle. MUST NOT be more than 2048 characters in length :param SimpleDataTable table: This contains a table of query results :param int row_count: The number of query results contained in the Table element. :param int total_rows: This element MUST contain the total number of results that match the conditions given in the search query and are of the type specified in the ResultType element. :param int total_rows_including_duplicates: This element SHOULD contain the total number of results, including duplicates, that match the conditions given in the search query and are of the type specified in the ResultType element

Parameters:

  • group_template_id: Parameter
  • item_template_id: Parameter
  • properties: Parameter
  • result_title: Parameter
  • result_title_url: Parameter
  • table: Parameter
  • row_count: Parameter
  • total_rows: Parameter
  • total_rows_including_duplicates: Parameter

Returns: See docstring for return details

set_property(self, k, v, persist_changes)

Purpose: Sets property

Parameters:

  • k: Parameter
  • v: Parameter
  • persist_changes: Parameter

Returns: None

entity_type_name(self) property

Purpose: Performs entity type name

Returns: None

Required Imports

from office365.runtime.client_value import ClientValue
from office365.runtime.odata.type import ODataType
from office365.sharepoint.search.simple_data_table import SimpleDataTable

Usage Example

# Example usage:
# result = RelevantResults(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class QueryResult 60.4% similar

    The QueryResult type is a grouping of result tables, where each contained result table is a ResultTable as specified in [MS-QSSWS] section 3.1.4.1.3.6.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/query_result.py
  • class SearchResult 56.7% similar

    The SearchResult structure resembles the ResultTableCollection structure (specified in [MS-QSSWS] section 3.1.4.1.3.1). However, the individual result tables that share the same QueryId are grouped together in a QueryResult structure (specified in section 3.1.5.2). The search result tables that have exactly the same QueryId value as specified by the protocol client are grouped in the same QueryResult structure accessed through the PrimaryQueryResult property. All other QueryResult buckets are organized in a CSOM array of QueryResults accessed through the SecondaryQueryResults property.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/result.py
  • class RefinementResults 51.4% similar

    A data class representing refinement results from a SharePoint search query, containing layout templates, refiners, and result metadata.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/refinement_results.py
  • class SpecialTermResults 46.1% similar

    A class representing a collection of special term results (best bets) that apply to a search query in SharePoint/Office 365 search operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/special_term_results.py
  • class CustomResult 45.8% similar

    A data class representing custom search query results with layout templates and properties for Microsoft Office Server Search REST API.

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