Package com.pspdfkit.document.library
Class QueryOptions.Builder
-
- All Implemented Interfaces:
public final class QueryOptions.Builder
Builder used to construct QueryOptions instance.
By default the number of returned search results is limited to 500 to limit possible search time. Use maximumPreviewResultsTotal and maximumSearchResultsTotal to change this default.
-
-
Constructor Summary
Constructors Constructor Description QueryOptions.Builder()
-
Method Summary
Modifier and Type Method Description QueryOptions.Builder
matchExactPhrases(boolean matchExactPhrases)
Enables exact phrase matching. QueryOptions.Builder
matchExactWords(boolean matchExactWords)
Enables exact word matching. QueryOptions.Builder
ignoreAnnotations(boolean ignoreAnnotations)
Prevents querying of indexed annotations. QueryOptions.Builder
ignoreDocumentText(boolean ignoreDocumentText)
Prevents querying of indexed document text. QueryOptions.Builder
maximumSearchResultsPerDocument(int maximumSearchResultsPerDocument)
Sets a limit of search results in each document. QueryOptions.Builder
maximumSearchResultsTotal(int maximumSearchResultsTotal)
Sets a limit of all search results. QueryOptions.Builder
maximumPreviewResultsPerDocument(int maximumPreviewResultsPerDocument)
Sets a limit of preview results in each document. QueryOptions.Builder
maximumPreviewResultsTotal(int maximumPreviewResultsTotal)
Sets a limit of all preview results. QueryOptions.Builder
generateTextPreviews(boolean generatePreviews)
Enables generation of search preview snippets. QueryOptions.Builder
previewRange(int start, int length)
Sets range for the preview generated. QueryOptions
build()
Builds query options. -
-
Method Detail
-
matchExactPhrases
@NonNull() QueryOptions.Builder matchExactPhrases(boolean matchExactPhrases)
Enables exact phrase matching.
- Parameters:
matchExactPhrases
-true
to enable exact phrase matching.
-
matchExactWords
@NonNull() QueryOptions.Builder matchExactWords(boolean matchExactWords)
Enables exact word matching.
- Parameters:
matchExactWords
-true
to enable exact word matching.
-
ignoreAnnotations
@NonNull() QueryOptions.Builder ignoreAnnotations(boolean ignoreAnnotations)
Prevents querying of indexed annotations.
- Parameters:
ignoreAnnotations
-true
to ignore indexed annotation content in the query.
-
ignoreDocumentText
@NonNull() QueryOptions.Builder ignoreDocumentText(boolean ignoreDocumentText)
Prevents querying of indexed document text.
- Parameters:
ignoreDocumentText
-true
to ignore indexed document text in the query.
-
maximumSearchResultsPerDocument
@NonNull() QueryOptions.Builder maximumSearchResultsPerDocument(int maximumSearchResultsPerDocument)
Sets a limit of search results in each document.
- Parameters:
maximumSearchResultsPerDocument
- Maximum number of search results in each document.
-
maximumSearchResultsTotal
@NonNull() QueryOptions.Builder maximumSearchResultsTotal(int maximumSearchResultsTotal)
Sets a limit of all search results.
- Parameters:
maximumSearchResultsTotal
- Maximum returned search results for this query.
-
maximumPreviewResultsPerDocument
@NonNull() QueryOptions.Builder maximumPreviewResultsPerDocument(int maximumPreviewResultsPerDocument)
Sets a limit of preview results in each document.
- Parameters:
maximumPreviewResultsPerDocument
- Maximum number of preview results in each document.
-
maximumPreviewResultsTotal
@NonNull() QueryOptions.Builder maximumPreviewResultsTotal(int maximumPreviewResultsTotal)
Sets a limit of all preview results.
- Parameters:
maximumPreviewResultsTotal
- Maximum returned preview results for this query.
-
generateTextPreviews
@NonNull() QueryOptions.Builder generateTextPreviews(boolean generatePreviews)
Enables generation of search preview snippets.
- Parameters:
generatePreviews
-true
to enable search previews.
-
previewRange
@NonNull() QueryOptions.Builder previewRange(int start, int length)
Sets range for the preview generated.
- Parameters:
start
- Starting index of preview snippet to be generated.length
- Length of preview snippet to be generated.
-
build
@NonNull() QueryOptions build()
Builds query options.
- Returns:
QueryOptions generated through this builder.
-
-
-
-