IndexingOptions class

IndexingOptions class

Provides options for the indexing operation.

Learn more:

The IndexingOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the IndexingOptions class.

Properties

Property Description
cancellation The operation cancellation object, defaulting to None.
is_async The flag indicating whether the operation is performed asynchronously. The default value is False.
separate_process_options The options for extracting data in a separate process.
threads The number of threads used for indexing (default is 1, must be between 1 and 4).
auto_detect_encoding The auto_detect_encoding flag indicates whether to detect encoding automatically. The default value is False. (inherited from BaseOptions)
encoding The encoding used to extract text from text documents. The default is None, which means UTF-8 is used. If AutoDetectEncoding is True, this value serves as the default encoding. (inherited from BaseOptions)
image_indexing_options The image indexing options for reverse image search. (inherited from BaseOptions)
metadata_indexing_options The options for indexing metadata fields. (inherited from BaseOptions)
ocr_indexing_options The options for OCR processing and indexing recognized text. (inherited from BaseOptions)
use_backup_privilege The property indicates whether the process should use the SeBackupPrivilege and FILE_FLAG_BACKUP_SEMANTICS to access files and directories. The default value is False. True enables privileged access using SeBackupPrivilege and FILE_FLAG_BACKUP_SEMANTICS; otherwise, False. (inherited from BaseOptions)
use_raw_text_extraction The property indicates whether raw text extraction mode is used if possible. The default is False; raw mode can significantly increase indexing speed, while normal mode improves formatting of extracted text. (inherited from BaseOptions)

Example

from groupdocs.search.options import IndexingOptions

def recognize(context):
    # Pass context.image_stream to your OCR engine and return the text it recognizes
    return None


# Create indexing options
options = IndexingOptions()
# Perform indexing asynchronously
options.is_async = True
# Use two threads for indexing
options.threads = 2
# Enable OCR for separate images and set the OCR connector
options.ocr_indexing_options.enabled_for_separate_images = True
options.ocr_indexing_options.ocr_connector = recognize

Guides

Task guides that use IndexingOptions:

See Also