PDF search matching options on Android
Pass a QueryOptions object to PdfLibrary’s search() method to configure matching and results.
The following options are available:
| Name | Type | Description |
|---|---|---|
generateTextPreviews | Boolean | Retrieves preview snippets of text when searching and delivers them in the onSearchPreviewsGenerated() callback. |
maximumSearchResultsTotal | int | The maximum amount of search results for the total of all documents. |
maximumSearchResultsPerDocument | int | The maximum amount of search results per document. |
matchExactWords | Boolean | Only matches exact words. For example, “something” doesn’t match “some.” |
matchExactPhrases | Boolean | Only matches exact phrases. For example, “this is a test” doesn’t match “this is a quick test.” |
Advanced configuration
Use these PdfLibrary methods to control reverse-text storage:
| Method | Type | Default | Description |
|---|---|---|---|
setSaveReverseText()/getSaveReverseText() | Boolean | true | Controls whether the library stores reversed PDF text. This approximately doubles the cache size and enables ends-with searches. |