Query Indexing
For query indexing to be available, you have to first enable this feature in the global PocketQuery configuration. We have found that query indexing can cause performance issues on large instances, which is why we don’t encourage to use this feature. For details, see: Known Issue: indexing performance impact of queries with "Add results to search"
For each query you can decide whether its results should be added to the Confluence search index. They can then be found using the search bar on the top right, which makes content discovery much easier.
If the Index checkbox is checked, all results retrieved with this query will be added to the Confluence index when:
a page (or other content object) with a PocketQuery macro using this query is edited, or
the PocketQuery Index Job runs (see below)
PocketQuery Index Job
One challenge using the Confluence search index for PocketQuery results is that changes are not detected by Confluence like they are with the content of Confluence pages: Confluence won’t recognize when something changes in your external database and the results of your macro should change consequently. In order to keep index data up-to-date, we implemented a Scheduled Job. Its task is to reindex all pages that contain a PocketQuery macro with a query that has indexing enabled. You can configure the job’s schedule at Confluence Admin > Scheduled Jobs:
The default schedule is to trigger the job every night at 1 AM. You might want to change this regarding your specific environment. Note that the job might be quite performance-intensive since it may iterate over a large set of pages, depending on how many PocketQuery macros are in your instance. Also, these queries are run against your external database to retrieve the latest results. (Feel free to disable the job if you don’t want to make use of this feature at all.)