class ReorderingRule
ReorderingRule is a class representing SharePoint search result reordering rules, inheriting from ClientValue to provide information about how search results should be reordered when specific conditions are met.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/query/reordering_rule.py
4 - 10
simple
Purpose
This class serves as a data model for SharePoint Client Search Query reordering rules. It encapsulates the configuration and metadata needed to define how search results should be reordered based on certain conditions. The class is part of the Office365 SharePoint Client library and is used to interact with SharePoint's search query reordering functionality. It inherits from ClientValue, which likely provides serialization and client-server communication capabilities for SharePoint API interactions.
Source Code
class ReorderingRule(ClientValue):
"""The ReorderingRule type contains information about how search results SHOULD be reordered if they met the
condition."""
@property
def entity_type_name(self):
return "Microsoft.SharePoint.Client.Search.Query.ReorderingRule"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
__init__: The constructor parameters are not explicitly defined in this code snippet. As it inherits from ClientValue, it likely accepts parameters defined by the parent class constructor. Typically, ClientValue-based classes accept property dictionaries or keyword arguments that map to SharePoint entity properties.
Return Value
Instantiating this class returns a ReorderingRule object that represents a SharePoint search reordering rule. The entity_type_name property returns the string 'Microsoft.SharePoint.Client.Search.Query.ReorderingRule', which identifies the SharePoint entity type for API communication.
Class Interface
Methods
@property entity_type_name(self) -> str
property
Purpose: Returns the fully qualified SharePoint entity type name for this reordering rule, used for API communication and type identification
Returns: String value 'Microsoft.SharePoint.Client.Search.Query.ReorderingRule' representing the SharePoint entity type
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.sharepoint.client.search.query.reordering_rule import ReorderingRule
Usage Example
from office365.runtime.client_value import ClientValue
from office365.sharepoint.client.search.query.reordering_rule import ReorderingRule
# Instantiate a ReorderingRule object
reordering_rule = ReorderingRule()
# Access the entity type name
entity_type = reordering_rule.entity_type_name
print(entity_type) # Output: Microsoft.SharePoint.Client.Search.Query.ReorderingRule
# Typically used within SharePoint search query context
# Example with search query (pseudo-code):
# search_query = SearchQuery()
# search_query.reordering_rules.add(reordering_rule)
# results = context.execute_query()
Best Practices
- This class is designed to be used within the Office365 SharePoint Client library context and should be instantiated as part of search query operations
- The class inherits from ClientValue, which handles serialization for SharePoint API communication - do not manually serialize instances
- The entity_type_name property is read-only and should not be modified as it identifies the SharePoint entity type
- Typically used in conjunction with SearchQuery objects to configure search result reordering behavior
- Ensure proper SharePoint authentication context is established before using this class in API operations
- This is a lightweight data model class with minimal state - instances can be created as needed without significant overhead
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ReorderingRuleCollection 85.0% similar
-
class PromotedResultQueryRule 69.6% similar
-
class Sort 68.6% similar
-
class RefinementResults 66.5% similar
-
class SPListRule 64.9% similar