SearchOptions

Inheritance: java.lang.Object

public class SearchOptions

Provides the options which are used for text search.

An instance of SearchOptions class is used as parameter in Parser.search(String, SearchOptions) method. See the usage examples there.

Learn more:

Constructors

Constructor Description
SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, boolean searchByPages, HighlightOptions leftHighlightOptions, HighlightOptions rightHighlightOptions) Initializes a new instance of the SearchOptions class.
SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, HighlightOptions leftHighlightOptions, HighlightOptions rightHighlightOptions) 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.
SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, HighlightOptions highlightOptions) 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.
SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression) Initializes a new instance of the SearchOptions class which is used to search without highlight extraction.
SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, boolean searchByPages) Initializes a new instance of the SearchOptions class which is used to search by pages and without highlight extraction.
SearchOptions() Initializes a new instance of the SearchOptions class with default values.

Methods

Method Description
isMatchCase() Gets the value that indicates whether a text case isn’t ignored.
isMatchWholeWord() Gets the value that indicates whether text search is limited by a whole word.
isUseRegularExpression() Gets the value that indicates whether a regular expression is used.
isSearchByPages() Gets the value that indicates whether the search is performed by pages.
getLeftHighlightOptions() Gets the options for the left highlight.
getRightHighlightOptions() Gets the options for the right highlight.

SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, boolean searchByPages, HighlightOptions leftHighlightOptions, HighlightOptions rightHighlightOptions)

public SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, boolean searchByPages, HighlightOptions leftHighlightOptions, HighlightOptions rightHighlightOptions)

Initializes a new instance of the SearchOptions class.

Parameters:

Parameter Type Description
matchCase boolean The value that indicates whether a text case isn’t ignored.
matchWholeWord boolean The value that indicates whether text search is limited by a whole word.
useRegularExpression boolean The value that indicates whether a regular expression is used.
searchByPages boolean The value that indicates whether the search is performed by pages.
leftHighlightOptions HighlightOptions The options for the left highlight.
rightHighlightOptions HighlightOptions The options for the right highlight.

SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, HighlightOptions leftHighlightOptions, HighlightOptions rightHighlightOptions)

public SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, HighlightOptions leftHighlightOptions, HighlightOptions rightHighlightOptions)

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.

Parameters:

Parameter Type Description
matchCase boolean The value that indicates whether a text case isn’t ignored.
matchWholeWord boolean The value that indicates whether text search is limited by a whole word.
useRegularExpression boolean The value that indicates whether a regular expression is used.
leftHighlightOptions HighlightOptions The options for the left highlight.
rightHighlightOptions HighlightOptions The options for the right highlight.

SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, HighlightOptions highlightOptions)

public SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, HighlightOptions highlightOptions)

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.

Parameters:

Parameter Type Description
matchCase boolean The value that indicates whether a text case isn’t ignored.
matchWholeWord boolean The value that indicates whether text search is limited by a whole word.
useRegularExpression boolean The value that indicates whether a regular expression is used.
highlightOptions HighlightOptions The options for both highlights.

SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression)

public SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression)

Initializes a new instance of the SearchOptions class which is used to search without highlight extraction.

Parameters:

Parameter Type Description
matchCase boolean The value that indicates whether a text case isn’t ignored.
matchWholeWord boolean The value that indicates whether text search is limited by a whole word.
useRegularExpression boolean The value that indicates whether a regular expression is used.

SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, boolean searchByPages)

public SearchOptions(boolean matchCase, boolean matchWholeWord, boolean useRegularExpression, boolean searchByPages)

Initializes a new instance of the SearchOptions class which is used to search by pages and without highlight extraction.

Parameters:

Parameter Type Description
matchCase boolean The value that indicates whether a text case isn’t ignored.
matchWholeWord boolean The value that indicates whether text search is limited by a whole word.
useRegularExpression boolean The value that indicates whether a regular expression is used.
searchByPages boolean The value that indicates whether the search is performed by pages.

SearchOptions()

public SearchOptions()

Initializes a new instance of the SearchOptions class with default values. See remarks for details.

The following properties have default values:

  • MatchCase: false
  • MatchWholeWord: false
  • UseRegularExpression: false
  • LeftHighlightOptions: null
  • RightHighlightOptions: null

isMatchCase()

public boolean isMatchCase()

Gets the value that indicates whether a text case isn’t ignored.

Returns: boolean - true if a text case isn’t ignored; otherwise, false .

isMatchWholeWord()

public boolean isMatchWholeWord()

Gets the value that indicates whether text search is limited by a whole word.

Returns: boolean - true if text search is limited by a whole word; otherwise, false .

isUseRegularExpression()

public boolean isUseRegularExpression()

Gets the value that indicates whether a regular expression is used.

Returns: boolean - true if a regular expression is used; otherwise, false .

isSearchByPages()

public boolean isSearchByPages()

Gets the value that indicates whether the search is performed by pages.

Returns: boolean - true if the search is performed by pages; otherwise, false and the search is performed on the whole document without including SearchResult.getPageIndex() property value in SearchResult class.

getLeftHighlightOptions()

public HighlightOptions getLeftHighlightOptions()

Gets the options for the left highlight.

Returns: HighlightOptions - An instance of HighlightOptions class; nill if it isn’t set.

getRightHighlightOptions()

public HighlightOptions getRightHighlightOptions()

Gets the options for the right highlight.

Returns: HighlightOptions - An instance of HighlightOptions class; nill if it isn’t set.