Task Management
Solr offers a task management framework, that allows users to monitor (and even cancel) certain types of long-running tasks. Queries are the only type of "task" currently supported, but additional types may be added in the future.
Registering Tasks for Task Management
Task-tracking and management is an opt-in feature: tracking must be explicitly enabled on each individual task.
For queries (the only type of "task" currently supported), this is done by specifying the canCancel
boolean flag as a query-parameter.
A value of true
enables task-management; false
(the default) leaves it disabled.
Solr will assign each task a UUID for tracking purposes.
Users may override this if desired with an arbitrary string of their choice using the queryUUID
query-parameter.
(Users are responsible for ensuring that any queryUUID
values they provide are unique and don’t conflict with other running tasks.)
This UUID, whether generated or provided by the user, can then be used to track or cancel the task.
Task Management Operations
Task management interface supports the following types of operations:
-
List all currently running cancellable tasks.
-
Cancel a specific task.
-
Query the status of a specific task.
Listing All Active Cancellable Tasks
To list all the active cancellable tasks currently running, please use the following syntax:
V1 API
curl -X GET "http://localhost:8983/solr/collectionName/tasks/list"
V2 API
curl -X GET "http://localhost:8983/v2/collections/collectionName/tasks/list"
Cancelling An Active Cancellable Task
To cancel an active task, please use the following syntax:
V1 API
curl -X GET "http://localhost:8983/solr/collectionName/tasks/cancel?queryUUID=5"
V2 API
curl -X GET "http://localhost:8983/v2/collections/collectionName/tasks/cancel?queryUUID=5"
Check Status of a Specific Task
To check the status of a specific task, please use the following syntax:
V1 API
curl -X GET "http://localhost:8983/solr/collectionName/tasks/list?taskUUID=5"
V2 API
curl -X GET "http://localhost:8983/v2/collections/collectionName/tasks/list?taskUUID=5"