class AlterationOptions
A class representing search alteration options for spelling correction in Office 365 SharePoint search operations.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/search/alteration_options.py
4 - 5
simple
Purpose
AlterationOptions is a data transfer object (DTO) that inherits from ClientValue and is used to configure spelling correction behavior in SharePoint search queries. It encapsulates options that control how search terms are altered or corrected when performing searches, allowing developers to customize the spelling correction features of SharePoint search.
Source Code
class AlterationOptions(ClientValue):
"""Provides the search alteration options for spelling correction."""
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
bases: Inherits from ClientValue, which is a base class for client-side value objects in the Office 365 SDK. This provides serialization and deserialization capabilities for communication with SharePoint REST APIs.
Return Value
Instantiation returns an AlterationOptions object that can be used to configure spelling correction settings in SharePoint search queries. The object inherits ClientValue's serialization capabilities for API communication.
Class Interface
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.sharepoint.search.query.alteration_options import AlterationOptions
Usage Example
from office365.sharepoint.search.query.alteration_options import AlterationOptions
from office365.runtime.client_value import ClientValue
# Instantiate AlterationOptions
alteration_opts = AlterationOptions()
# This object would typically be used as part of a SearchRequest
# to configure spelling correction behavior in SharePoint search
# Example in context of a search query:
# search_request = SearchRequest()
# search_request.alteration_options = alteration_opts
# results = client.search(search_request)
Best Practices
- This class is typically used as part of a larger SearchRequest object rather than standalone
- As a ClientValue subclass, it should be serializable to JSON for API communication
- The class appears to be a container for search alteration settings - check the parent ClientValue class for inherited methods like to_json() or from_json()
- Instantiate this class when you need to customize spelling correction behavior in SharePoint search queries
- The actual properties/attributes for configuring spelling correction are likely defined in the parent ClientValue class or should be set as instance attributes after instantiation
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class SharePointOneDriveOptions 67.3% similar
-
class FilePickerOptions 61.2% similar
-
class MoveCopyOptions 60.8% similar
-
class QueryAutoCompletionMatch 57.2% similar
-
class BaseGptRequestOptions 57.0% similar