Tasks

Dynamicweb features a generalized search framework usually referred to as Indexing, which can be used to index and query all kinds of data on your solution – productscontentusersfiles, etc.

Broadly speaking, Indexing consists of the following elements:

  • Indexes are data structures optimized for data retrieval
  • Queries are used to retrieve data based on criteria you define
  • Facets are used to create filters in frontend
  • Tasks are used to rebuild indexes on a schedule

All of these elements can be heavily configured to suit your particular scenario – and all exist within a so-called repository, which is simply a folder in the file archive containing configuration files.

This article will tell you more about Tasks - the scheduled activities that rebuild your indexes at predefined intervals. There are two types of tasks for rebuilding an index:

  • Repository tasks
  • Scheduled tasks using the Build repository index add-in

For technical reasons, we recommend that you migrate your existing repository tasks to using the new scheduled task add-in instead.

Repository tasks are a type of scheduled task which is created on the repository itselt - they are then triggered by a regular scheduled task called Repository task handler.

To create a repository task:

  • Click Add Task in the repository toolbar
  • Provide a name
  • Click OK

This opens the Task configuration view (Figure 2.1).

Figure 2.1 The Task configuration view

To configure the task:

  • Select a start time and optionally an end time
  • Select the interval with which you want to run the task – please keep in mind that rebuilding indexes can be resource demanding
  • Select a task provider (we supply one out of the box, the IndexBuilderTaskProvider, but you can create your own)
  • Configure the parameters supplied by the task provider – by default:
    • Select an Index to rebuild
    • Select a Build configuration to use

Please note: The tasks created here depend on an autogenerated scheduled task called Repository Task Handler executing them. If your tasks are not executed in a timely manner, it may be because the Repository Task Hander is set to run at an interval longer than the intervals on the repository tasks.

As an alternative to repository tasks, we recommend creating a regular scheduled task using the Build repository index add-in (Figure 3.1). This add-in allows you to select and index with 2 builds (e.g. full and partial) and execute them using the same scheduled task.

Figure 3.1 The Build Repository Index add-in