Cached search results

A useful feature you can use with Search and SavedSearch managers is cached search results, which lets you display the results from an identical search job if one exists. Using cached results during development saves you time―rather than waiting for a long search to run each time you modify a page and reload it, you can display the cached results immediately.

In order for search jobs to be considered identical, the search jobs must have the same label, and all of the search parameters (such as the earliest_time and latest_time) and the search query must be exactly the same.

    Note  When caching is enabled for a search manager and an identical search job is found, the search still runs and is not cancelled because other users or views might be using it.

To use cached search results, set the search manager's cache property to one of the following values:

  • true: Always use the results from a preexisting search job when possible.
  • false: Never use results from preexisting search jobs.
  • scheduled: Reuse any previously-run scheduled jobs (for saved reports only).
  • n: The number of seconds indicating the maximum age a search job can be to use its results. Results from search jobs that are newer than n seconds will be used.