# PDF search matching options on Android

[`PdfLibrary`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document.library/-pdf-library/index.html) offers advanced matching options. You pass these options with a [`QueryOptions`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document.library/-query-options/index.html) object in the `search()` method.

The following options are available:

| Name                        | Type      | Description                                                                                                            |
| --------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
| `generateTextPreviews`      | `Boolean` | Retrieves preview snippets of text when searching and delivers them in the [`onSearchPreviewsGenerated()`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document.library/-query-options/-builder/generate-text-previews.html) callback. |
| `maximumResultsTotal`       | `int`     | The maximum amount of search results for the total of all documents.                                                   |
| `maximumResultsPerDocument` | `int`     | The maximum amount of search results per page.                                                                         |
| `matchExactWords`           | `Boolean` | Only matches exact words. For example, “something” would not match “some.”                                             |
| `matchExactPhrases`         | `Boolean` | Only matches exact phrases. For example, “this is a test” would not match “this is a quick test.”                      |

## Advanced configuration

You can configure [`PdfLibrary`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document.library/-pdf-library/index.html) to match your needs. The following properties on [`PdfLibrary`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document.library/-pdf-library/index.html) are available:

| Property               | Type      | Default | Description                                                                                                                                                      |
| ---------------------- | --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `saveReversedPageText` | `Boolean` | `true`  | Indicates if the reversed text of a PDF document should be saved. This increases the size of the cache by about two times, but it allows for ends-with searches. |
---

## Related pages

- [Indexing PDF documents on Android](/guides/android/features/indexed-full-text-search.md)

