public static class

SearchConfiguration.Builder

extends Object
java.lang.Object
   ↳ com.pspdfkit.configuration.search.SearchConfiguration.Builder

Class Overview

Builder to create SearchConfiguration instances.

Summary

Public Constructors
Builder()
Public Methods
SearchConfiguration build()
Builds SearchConfiguration from the values provided to the builder.
SearchConfiguration.Builder maxSearchResults(int maxSearchResults)
Limits the maximum number of search results.
SearchConfiguration.Builder setSnippetLength(int snippetLength)
Sets the number of preview characters extracted with every search result.
SearchConfiguration.Builder setStartSearchChars(int startSearchChars)
Sets the number of characters that need to be entered for the search to start.
SearchConfiguration.Builder setStartSearchOnCurrentPage(boolean startSearchOnCurrentPage)
Sets whether the search should start on the current page or not.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder ()

Public Methods

public SearchConfiguration build ()

Builds SearchConfiguration from the values provided to the builder.

Returns
  • Built search configuration.

public SearchConfiguration.Builder maxSearchResults (int maxSearchResults)

Limits the maximum number of search results. If not set maxSearchResults will be used by default. To turn off limiting use UNLIMITED_SEARCH_RESULTS.

Parameters
maxSearchResults Maximum count of search results to return, or UNLIMITED_SEARCH_RESULTS to turn off limiting.

public SearchConfiguration.Builder setSnippetLength (int snippetLength)

Sets the number of preview characters extracted with every search result.

Parameters
snippetLength Number of characters, defaults to {@value DEFAULT_SNIPPET_LENGTH}.

public SearchConfiguration.Builder setStartSearchChars (int startSearchChars)

Sets the number of characters that need to be entered for the search to start.

Parameters
startSearchChars Number of characters needed to trigger the search, defaults to {@value DEFAULT_START_SEARCH_CHARS}.

public SearchConfiguration.Builder setStartSearchOnCurrentPage (boolean startSearchOnCurrentPage)

Sets whether the search should start on the current page or not. This defaults to {@value DEFAULT_START_SEARCH_ON_CURRENT_PAGE}.

Parameters
startSearchOnCurrentPage true to start search on the current page, false to start from the beginning of the document.