Indicates whether the search is limited to whole words.
use_regular_expression
bool
Indicates whether a regular expression is used.
search_by_pages
bool
Indicates whether the search is performed by pages.
left_highlight_options
HighlightOptions
The options for the left highlight.
right_highlight_options
HighlightOptions
The options for the right highlight.
Example
fromgroupdocs.parserimportParserfromgroupdocs.parser.optionsimportSearchOptionswithParser("sample.pdf")asparser:options=SearchOptions(False,False,False,True)results=parser.search("lorem",options)ifresultsisNone:print("Search isn't supported for this format.")else:forresultinresults:print(f"Found on page {result.page_index+1}: {result.text}")
init
Initializes a new instance of the SearchOptions class with the page limit.
The value that indicates whether a text case isn’t ignored.
match_whole_word
bool
The value that indicates whether text search is limited by a whole word.
use_regular_expression
bool
The value that indicates whether a regular expression is used.
max_page_index
int
The value that indicates whether the search is performed by pages.
left_highlight_options
HighlightOptions
The options for the left highlight.
right_highlight_options
HighlightOptions
The options for the right highlight.
Example
fromgroupdocs.parserimportParserfromgroupdocs.parser.optionsimportSearchOptionswithParser("sample.pdf")asparser:# match_case, match_whole_word, use_regular_expression, search_by_pagesoptions=SearchOptions(False,False,False,True)results=parser.search("lorem",options)ifresultsisNone:print("Search isn't supported for this format.")else:forresultinresults:print(f"Found on page {result.page_index+1}: {result.text}")
init
Initializes a new instance of the SearchOptions class which is used to search with the highlight options for the left and the right highlight extraction.
The value that indicates whether a text case isn’t ignored.
match_whole_word
bool
The value that indicates whether text search is limited by a whole word.
use_regular_expression
bool
The value that indicates whether a regular expression is used.
left_highlight_options
HighlightOptions
The options for the left highlight.
right_highlight_options
HighlightOptions
The options for the right highlight.
init
Initializes a new instance of the SearchOptions class which is used to search with the same highlight options for the left and the right highlight extraction.
Indicates whether text search is limited to whole words.
use_regular_expression
bool
Indicates whether a regular expression is used.
search_by_pages
bool
Indicates whether the search is performed by pages.
Example
fromgroupdocs.parserimportParserfromgroupdocs.parser.optionsimportSearchOptionswithParser("sample.pdf")asparser:# match_case, match_whole_word, use_regular_expression, search_by_pagesoptions=SearchOptions(False,False,False,True)results=parser.search("lorem",options)ifresultsisNone:print("Search isn't supported for this format.")else:forresultinresults:print(f"Found on page {result.page_index+1}: {result.text}")
init
Initializes a new instance of the SearchOptions class with default values.